ClashMetaForAndroid/.github/workflows/build-release.yaml

120 lines
3.9 KiB
YAML
Raw Normal View History

Update Meta Core to v1.16.0 and add actions to help maintain the project (#147) * add: Create dependabot.yml * chore: Create update-dependencies.yml * chore: Update update-dependencies.yml * fix: switch meta core upstream * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update build-unsigned.yaml * chore: Delete .github/dependabot.yml * chore: Run build-unsigned for each PR * chore: Better PR info and add repo dispatch listener * chore: Better actions name * chore: rename ci file and try to fix failure * chore: add manual auto project version bump * chore: Fix wrong command usage * chore: fix path * chore: Fix * chore: Fix bump project version * chore: can this pass compile? * chore: update core to newest alpha * Update update-dependencies.yaml * chore: try to change core upstream * chore: remove all go get update to pass compile * Revert "chore: remove all go get update to pass compile" This reverts commit aad0ec3b83b51062c877f0487cb55f4ae7c3e617. * Revert "chore: can this pass compile?" This reverts commit 635289639b199d28d3d865849e5e7b7595f51522. * chore: force update submodule * chore: change upstream to alpha * chore: remove rubbish * chore: change upstream and update core * chore: add version fixed packages * chore: small fix * chore: update go dependencies * chore: revert some depends to old versions to fix compile * fix: fix compile error caused by core's deprecation * chore: fix actions and update core * chore: update clash core * fix: fix block calling * chore: update app version * chore: small fix to actions * feat: add Hysteria2 for UI * chore: revert version update for actions test * chore: try recover main go mod upgrade * chore: fix tag logic in release actions * Bump version to 2.8.10 (208010) * chore: remove test code in actions --------- Co-authored-by: GitHub Action <action@github.com>
2023-10-22 10:57:35 +03:00
name: Build Release
2023-05-10 13:10:50 +03:00
on:
2023-05-10 20:48:59 +03:00
workflow_dispatch:
Update Meta Core to v1.16.0 and add actions to help maintain the project (#147) * add: Create dependabot.yml * chore: Create update-dependencies.yml * chore: Update update-dependencies.yml * fix: switch meta core upstream * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update build-unsigned.yaml * chore: Delete .github/dependabot.yml * chore: Run build-unsigned for each PR * chore: Better PR info and add repo dispatch listener * chore: Better actions name * chore: rename ci file and try to fix failure * chore: add manual auto project version bump * chore: Fix wrong command usage * chore: fix path * chore: Fix * chore: Fix bump project version * chore: can this pass compile? * chore: update core to newest alpha * Update update-dependencies.yaml * chore: try to change core upstream * chore: remove all go get update to pass compile * Revert "chore: remove all go get update to pass compile" This reverts commit aad0ec3b83b51062c877f0487cb55f4ae7c3e617. * Revert "chore: can this pass compile?" This reverts commit 635289639b199d28d3d865849e5e7b7595f51522. * chore: force update submodule * chore: change upstream to alpha * chore: remove rubbish * chore: change upstream and update core * chore: add version fixed packages * chore: small fix * chore: update go dependencies * chore: revert some depends to old versions to fix compile * fix: fix compile error caused by core's deprecation * chore: fix actions and update core * chore: update clash core * fix: fix block calling * chore: update app version * chore: small fix to actions * feat: add Hysteria2 for UI * chore: revert version update for actions test * chore: try recover main go mod upgrade * chore: fix tag logic in release actions * Bump version to 2.8.10 (208010) * chore: remove test code in actions --------- Co-authored-by: GitHub Action <action@github.com>
2023-10-22 10:57:35 +03:00
inputs:
2023-11-02 20:53:59 +03:00
release-tag:
description: 'Release Tag (v2.x.x)'
required: true
2023-05-10 13:10:50 +03:00
jobs:
BuildRelease:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
2023-05-10 13:10:50 +03:00
- name: Checkout submodules
run: git submodule update --init --recursive --remote
- name: Setup Java
uses: actions/setup-java@v4
2023-05-10 13:10:50 +03:00
with:
distribution: 'zulu'
java-version: 17
- name: Setup Go
uses: actions/setup-go@v5
2023-05-10 13:10:50 +03:00
with:
2024-08-15 08:39:12 +03:00
go-version: "1.23"
2023-05-10 13:10:50 +03:00
- uses: actions/cache@v4
2023-05-10 13:10:50 +03:00
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Update Meta Core to v1.16.0 and add actions to help maintain the project (#147) * add: Create dependabot.yml * chore: Create update-dependencies.yml * chore: Update update-dependencies.yml * fix: switch meta core upstream * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update build-unsigned.yaml * chore: Delete .github/dependabot.yml * chore: Run build-unsigned for each PR * chore: Better PR info and add repo dispatch listener * chore: Better actions name * chore: rename ci file and try to fix failure * chore: add manual auto project version bump * chore: Fix wrong command usage * chore: fix path * chore: Fix * chore: Fix bump project version * chore: can this pass compile? * chore: update core to newest alpha * Update update-dependencies.yaml * chore: try to change core upstream * chore: remove all go get update to pass compile * Revert "chore: remove all go get update to pass compile" This reverts commit aad0ec3b83b51062c877f0487cb55f4ae7c3e617. * Revert "chore: can this pass compile?" This reverts commit 635289639b199d28d3d865849e5e7b7595f51522. * chore: force update submodule * chore: change upstream to alpha * chore: remove rubbish * chore: change upstream and update core * chore: add version fixed packages * chore: small fix * chore: update go dependencies * chore: revert some depends to old versions to fix compile * fix: fix compile error caused by core's deprecation * chore: fix actions and update core * chore: update clash core * fix: fix block calling * chore: update app version * chore: small fix to actions * feat: add Hysteria2 for UI * chore: revert version update for actions test * chore: try recover main go mod upgrade * chore: fix tag logic in release actions * Bump version to 2.8.10 (208010) * chore: remove test code in actions --------- Co-authored-by: GitHub Action <action@github.com>
2023-10-22 10:57:35 +03:00
2023-11-02 20:53:59 +03:00
- name: Convert and set version env
id: process-version
Update Meta Core to v1.16.0 and add actions to help maintain the project (#147) * add: Create dependabot.yml * chore: Create update-dependencies.yml * chore: Update update-dependencies.yml * fix: switch meta core upstream * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update build-unsigned.yaml * chore: Delete .github/dependabot.yml * chore: Run build-unsigned for each PR * chore: Better PR info and add repo dispatch listener * chore: Better actions name * chore: rename ci file and try to fix failure * chore: add manual auto project version bump * chore: Fix wrong command usage * chore: fix path * chore: Fix * chore: Fix bump project version * chore: can this pass compile? * chore: update core to newest alpha * Update update-dependencies.yaml * chore: try to change core upstream * chore: remove all go get update to pass compile * Revert "chore: remove all go get update to pass compile" This reverts commit aad0ec3b83b51062c877f0487cb55f4ae7c3e617. * Revert "chore: can this pass compile?" This reverts commit 635289639b199d28d3d865849e5e7b7595f51522. * chore: force update submodule * chore: change upstream to alpha * chore: remove rubbish * chore: change upstream and update core * chore: add version fixed packages * chore: small fix * chore: update go dependencies * chore: revert some depends to old versions to fix compile * fix: fix compile error caused by core's deprecation * chore: fix actions and update core * chore: update clash core * fix: fix block calling * chore: update app version * chore: small fix to actions * feat: add Hysteria2 for UI * chore: revert version update for actions test * chore: try recover main go mod upgrade * chore: fix tag logic in release actions * Bump version to 2.8.10 (208010) * chore: remove test code in actions --------- Co-authored-by: GitHub Action <action@github.com>
2023-10-22 10:57:35 +03:00
run: |
2023-11-02 20:53:59 +03:00
VERSION_TAG=${{ inputs.release-tag }}
2023-11-03 05:29:19 +03:00
VERSION_TAG=${VERSION_TAG#v} # remove the 'v' prefix
2023-11-02 20:53:59 +03:00
IFS='.' read -ra VERSION_PARTS <<< "$VERSION_TAG" # split into array
VERSION_CODE=$(printf "%1d%02d%03d" "${VERSION_PARTS[0]}" "${VERSION_PARTS[1]}" "${VERSION_PARTS[2]}")
2023-11-03 05:29:19 +03:00
echo "versonName=$VERSION_TAG" >> $GITHUB_OUTPUT # "1.2.3"
echo "versonCode=$VERSION_CODE" >> $GITHUB_OUTPUT # "102003"
Update Meta Core to v1.16.0 and add actions to help maintain the project (#147) * add: Create dependabot.yml * chore: Create update-dependencies.yml * chore: Update update-dependencies.yml * fix: switch meta core upstream * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update build-unsigned.yaml * chore: Delete .github/dependabot.yml * chore: Run build-unsigned for each PR * chore: Better PR info and add repo dispatch listener * chore: Better actions name * chore: rename ci file and try to fix failure * chore: add manual auto project version bump * chore: Fix wrong command usage * chore: fix path * chore: Fix * chore: Fix bump project version * chore: can this pass compile? * chore: update core to newest alpha * Update update-dependencies.yaml * chore: try to change core upstream * chore: remove all go get update to pass compile * Revert "chore: remove all go get update to pass compile" This reverts commit aad0ec3b83b51062c877f0487cb55f4ae7c3e617. * Revert "chore: can this pass compile?" This reverts commit 635289639b199d28d3d865849e5e7b7595f51522. * chore: force update submodule * chore: change upstream to alpha * chore: remove rubbish * chore: change upstream and update core * chore: add version fixed packages * chore: small fix * chore: update go dependencies * chore: revert some depends to old versions to fix compile * fix: fix compile error caused by core's deprecation * chore: fix actions and update core * chore: update clash core * fix: fix block calling * chore: update app version * chore: small fix to actions * feat: add Hysteria2 for UI * chore: revert version update for actions test * chore: try recover main go mod upgrade * chore: fix tag logic in release actions * Bump version to 2.8.10 (208010) * chore: remove test code in actions --------- Co-authored-by: GitHub Action <action@github.com>
2023-10-22 10:57:35 +03:00
2023-11-02 20:53:59 +03:00
# Re-write version in build.gradle.kts
- name: Re-write version
uses: Devofure/advance-android-version-actions@v1.5
2023-11-02 20:53:59 +03:00
with:
gradlePath: build.gradle.kts
versionCode: ${{ steps.process-version.outputs.versonCode }}
versionName: ${{ steps.process-version.outputs.versonName }}
Update Meta Core to v1.16.0 and add actions to help maintain the project (#147) * add: Create dependabot.yml * chore: Create update-dependencies.yml * chore: Update update-dependencies.yml * fix: switch meta core upstream * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update build-unsigned.yaml * chore: Delete .github/dependabot.yml * chore: Run build-unsigned for each PR * chore: Better PR info and add repo dispatch listener * chore: Better actions name * chore: rename ci file and try to fix failure * chore: add manual auto project version bump * chore: Fix wrong command usage * chore: fix path * chore: Fix * chore: Fix bump project version * chore: can this pass compile? * chore: update core to newest alpha * Update update-dependencies.yaml * chore: try to change core upstream * chore: remove all go get update to pass compile * Revert "chore: remove all go get update to pass compile" This reverts commit aad0ec3b83b51062c877f0487cb55f4ae7c3e617. * Revert "chore: can this pass compile?" This reverts commit 635289639b199d28d3d865849e5e7b7595f51522. * chore: force update submodule * chore: change upstream to alpha * chore: remove rubbish * chore: change upstream and update core * chore: add version fixed packages * chore: small fix * chore: update go dependencies * chore: revert some depends to old versions to fix compile * fix: fix compile error caused by core's deprecation * chore: fix actions and update core * chore: update clash core * fix: fix block calling * chore: update app version * chore: small fix to actions * feat: add Hysteria2 for UI * chore: revert version update for actions test * chore: try recover main go mod upgrade * chore: fix tag logic in release actions * Bump version to 2.8.10 (208010) * chore: remove test code in actions --------- Co-authored-by: GitHub Action <action@github.com>
2023-10-22 10:57:35 +03:00
2023-11-02 20:53:59 +03:00
# If any change found, commit it and push
- name: Commit and push if changes
Update Meta Core to v1.16.0 and add actions to help maintain the project (#147) * add: Create dependabot.yml * chore: Create update-dependencies.yml * chore: Update update-dependencies.yml * fix: switch meta core upstream * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update build-unsigned.yaml * chore: Delete .github/dependabot.yml * chore: Run build-unsigned for each PR * chore: Better PR info and add repo dispatch listener * chore: Better actions name * chore: rename ci file and try to fix failure * chore: add manual auto project version bump * chore: Fix wrong command usage * chore: fix path * chore: Fix * chore: Fix bump project version * chore: can this pass compile? * chore: update core to newest alpha * Update update-dependencies.yaml * chore: try to change core upstream * chore: remove all go get update to pass compile * Revert "chore: remove all go get update to pass compile" This reverts commit aad0ec3b83b51062c877f0487cb55f4ae7c3e617. * Revert "chore: can this pass compile?" This reverts commit 635289639b199d28d3d865849e5e7b7595f51522. * chore: force update submodule * chore: change upstream to alpha * chore: remove rubbish * chore: change upstream and update core * chore: add version fixed packages * chore: small fix * chore: update go dependencies * chore: revert some depends to old versions to fix compile * fix: fix compile error caused by core's deprecation * chore: fix actions and update core * chore: update clash core * fix: fix block calling * chore: update app version * chore: small fix to actions * feat: add Hysteria2 for UI * chore: revert version update for actions test * chore: try recover main go mod upgrade * chore: fix tag logic in release actions * Bump version to 2.8.10 (208010) * chore: remove test code in actions --------- Co-authored-by: GitHub Action <action@github.com>
2023-10-22 10:57:35 +03:00
run: |
2023-11-02 20:53:59 +03:00
changes=$(git diff --name-only origin/main | wc -l)
if [ $changes -gt 0 ]
then
newVersionName=${{ steps.process-version.outputs.versonName }}
newVersionCode=${{ steps.process-version.outputs.versonCode }}
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
git add build.gradle.kts
git commit -am "Bump version to $newVersionName ($newVersionCode)"
git tag "v$newVersionName"
git push --follow-tags
fi
2023-05-10 13:10:50 +03:00
- name: Signing properties
env:
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
run: |
touch signing.properties
echo keystore.password="$SIGNING_STORE_PASSWORD" > signing.properties
echo key.alias="$SIGNING_KEY_ALIAS" >> signing.properties
echo key.password="$SIGNING_KEY_PASSWORD" >> signing.properties
echo "cat signing.properties"
cat signing.properties
- name: Release Build
if: success()
2024-02-14 13:56:48 +03:00
uses: gradle/gradle-build-action@v3
2023-05-10 13:10:50 +03:00
with:
arguments: --no-daemon app:assembleMetaRelease
- name: Tag Repo
uses: richardsimko/update-tag@v1
with:
2023-11-03 05:29:19 +03:00
tag_name: ${{ inputs.release-tag }}
2023-05-10 13:10:50 +03:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release
uses: softprops/action-gh-release@v1
2023-10-22 11:56:10 +03:00
if: ${{ success() }}
2023-05-10 13:10:50 +03:00
with:
2023-11-03 05:29:19 +03:00
tag_name: ${{ inputs.release-tag }}
2023-05-10 13:10:50 +03:00
files: app/build/outputs/apk/meta/release/*
generate_release_notes: true
- name: Release Changelog Builder
uses: mikepenz/release-changelog-builder-action@v4.1.1
2023-11-02 20:53:59 +03:00
with:
configurationJson: |
{
"ignore_labels": [
"Update"
],
}