2023-10-22 15:57:35 +08:00
|
|
|
name: Build Pre-Release
|
2022-06-16 15:24:43 +08:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2024-04-20 11:01:04 +08:00
|
|
|
pull_request:
|
|
|
|
branches: [main]
|
|
|
|
types: [closed]
|
2022-06-16 15:24:43 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
BuildPreRelease:
|
2024-04-20 11:01:04 +08:00
|
|
|
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
|
2022-06-16 15:24:43 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
2024-01-18 16:52:50 +08:00
|
|
|
uses: actions/checkout@v4
|
2022-06-18 13:21:23 +08:00
|
|
|
|
|
|
|
- name: Checkout submodules
|
2023-10-26 21:20:21 +08:00
|
|
|
run: git submodule update --init --recursive --remote --force
|
2022-06-16 15:24:43 +08:00
|
|
|
|
|
|
|
- name: Setup Java
|
2024-01-18 16:52:50 +08:00
|
|
|
uses: actions/setup-java@v4
|
2022-06-16 15:24:43 +08:00
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: 17
|
|
|
|
|
2024-09-10 22:59:03 +08:00
|
|
|
- name: Setup Gradle
|
|
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
|
2022-06-16 15:24:43 +08:00
|
|
|
- name: Setup Go
|
2024-01-18 16:52:50 +08:00
|
|
|
uses: actions/setup-go@v5
|
2022-06-16 15:24:43 +08:00
|
|
|
with:
|
2024-08-15 13:39:12 +08:00
|
|
|
go-version: "1.23"
|
2022-06-16 15:24:43 +08:00
|
|
|
|
2024-01-18 16:52:50 +08:00
|
|
|
- uses: actions/cache@v4
|
2022-06-16 15:24:43 +08:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/go-build
|
|
|
|
~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
|
2022-06-18 08:16:17 +08: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: Pre-release Build
|
2022-06-16 15:24:43 +08:00
|
|
|
if: success()
|
2024-09-12 10:53:54 +08:00
|
|
|
run: ./gradlew --no-daemon app:assembleAlphaRelease
|
2022-06-16 15:24:43 +08:00
|
|
|
|
2023-11-03 01:54:56 +08:00
|
|
|
# Delete old Prerelease-alpha
|
2024-04-20 13:21:55 +08:00
|
|
|
- uses: dev-drprasad/delete-tag-and-release@v1.1
|
2022-06-16 15:24:43 +08:00
|
|
|
with:
|
2023-11-03 01:54:56 +08:00
|
|
|
tag_name: Prerelease-alpha
|
2022-06-16 15:24:43 +08:00
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2023-11-03 01:54:56 +08:00
|
|
|
delete_release: true
|
2022-06-18 08:16:17 +08:00
|
|
|
|
2022-06-16 15:24:43 +08:00
|
|
|
- name: Tag Repo
|
|
|
|
uses: richardsimko/update-tag@v1
|
|
|
|
with:
|
2022-06-18 12:49:23 +08:00
|
|
|
tag_name: Prerelease-alpha
|
2022-06-16 15:24:43 +08:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Upload Alpha
|
2024-04-20 13:21:55 +08:00
|
|
|
uses: softprops/action-gh-release@v2
|
2022-06-16 15:24:43 +08:00
|
|
|
if: ${{ success() }}
|
|
|
|
with:
|
2022-06-18 12:49:23 +08:00
|
|
|
tag_name: Prerelease-alpha
|
2024-09-12 10:53:54 +08:00
|
|
|
files: app/build/outputs/apk/alpha/release/*
|
2022-06-16 15:24:43 +08:00
|
|
|
prerelease: true
|
|
|
|
generate_release_notes: true
|
2023-02-09 16:30:15 +08:00
|
|
|
|
|
|
|
- name: Release Changelog Builder
|
2024-04-20 13:21:55 +08:00
|
|
|
uses: mikepenz/release-changelog-builder-action@v4
|