mirror of
https://github.com/wgtunnel/android.git
synced 2026-07-03 14:07:49 +02:00
Compare commits
12 Commits
5.0.7
...
improve-ci
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d8953bf4e | |||
| 375cc978c5 | |||
| 0f4399bb62 | |||
| 00fb8c7d29 | |||
| ab271225de | |||
| 9180344043 | |||
| c5a2f6e311 | |||
| 4780c9bd6f | |||
| 6350ab6752 | |||
| f6cf33b996 | |||
| 9872f4da2b | |||
| b6fd93eae5 |
@@ -1,4 +1,6 @@
|
|||||||
name: Build
|
name: build
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -94,10 +96,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
store_path=${{ env.KEY_STORE_LOCATION }}${{ env.KEY_STORE_FILE }}
|
store_path=${{ env.KEY_STORE_LOCATION }}${{ env.KEY_STORE_FILE }}
|
||||||
echo "KEY_STORE_PATH=$store_path" >> $GITHUB_ENV
|
echo "KEY_STORE_PATH=$store_path" >> $GITHUB_ENV
|
||||||
- name: Create service_account.json
|
|
||||||
if: ${{ inputs.build_type != 'debug' }}
|
|
||||||
id: createServiceAccount
|
|
||||||
run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json
|
|
||||||
- name: Build APK
|
- name: Build APK
|
||||||
run: |
|
run: |
|
||||||
flavor=${{ inputs.flavor }}
|
flavor=${{ inputs.flavor }}
|
||||||
@@ -123,6 +122,6 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: android_artifacts_${{ inputs.flavor }}
|
name: android_artifacts_${{ inputs.flavor }}
|
||||||
path: app/build/outputs/apk/${{ inputs.flavor }}/release/wgtunnel-${{ inputs.flavor }}-release-*.apk
|
path: app/build/outputs/apk/${{ inputs.flavor }}/${{ inputs.build_type }}/wgtunnel-${{ inputs.flavor }}${{ inputs.flavor == 'fdroid' && '-release' || '' }}-*.apk
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
if-no-files-found: warn
|
if-no-files-found: warn
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
name: nightly
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: "4 3 * * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_commits:
|
||||||
|
name: Check for New Commits
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
has_new_commits: ${{ steps.check.outputs.new_commits }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Check for new commits
|
||||||
|
id: check
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
|
run: |
|
||||||
|
NEW_COMMITS=$(git rev-list --count --after="$(date -Iseconds -d '23 hours ago')" ${{ github.sha }})
|
||||||
|
echo "new_commits=$NEW_COMMITS" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
build-standalone-nightly:
|
||||||
|
uses: ./.github/workflows/build.yml
|
||||||
|
secrets: inherit
|
||||||
|
with:
|
||||||
|
build_type: "nightly"
|
||||||
|
flavor: standalone
|
||||||
|
|
||||||
|
publish:
|
||||||
|
needs:
|
||||||
|
- check_commits
|
||||||
|
- build-standalone-nightly
|
||||||
|
if: ${{ needs.check_commits.outputs.has_new_commits > 0 && inputs.release_type != 'none' }}
|
||||||
|
name: publish-nightly
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt update && sudo apt install -y gh apksigner
|
||||||
|
- name: Set latest tag
|
||||||
|
uses: rickstaa/action-create-tag@v1
|
||||||
|
id: tag_creation
|
||||||
|
with:
|
||||||
|
tag: "latest"
|
||||||
|
message: "Automated tag for HEAD commit"
|
||||||
|
force_push_tag: true
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
tag_exists_error: false
|
||||||
|
|
||||||
|
- name: Generate Changelog
|
||||||
|
id: changelog
|
||||||
|
uses: requarks/changelog-action@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
toTag: "nightly"
|
||||||
|
fromTag: "latest"
|
||||||
|
writeToFile: false
|
||||||
|
|
||||||
|
- name: Make download dir
|
||||||
|
run: mkdir ${{ github.workspace }}/temp
|
||||||
|
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
pattern: android_artifacts_*
|
||||||
|
path: ${{ github.workspace }}/temp
|
||||||
|
|
||||||
|
- name: Set release notes
|
||||||
|
run: |
|
||||||
|
echo "RELEASE_NOTES=Nightly build for the latest development version of the app." >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Delete previous nightly version
|
||||||
|
uses: ClementTsang/delete-tag-and-release@v0.4.0
|
||||||
|
with:
|
||||||
|
tag_name: "nightly"
|
||||||
|
delete_release: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Get checksum
|
||||||
|
id: checksum
|
||||||
|
run: |
|
||||||
|
file_path=$(find ${{ github.workspace }}/temp -type f -iname "*.apk" | head -n 1)
|
||||||
|
if [ -z "$file_path" ]; then
|
||||||
|
echo "No APK file found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
checksum=$(apksigner verify --print-certs "$file_path" | grep -Po "(?<=SHA-256 digest:) .*" | tr -d "[:blank:]")
|
||||||
|
echo "checksum=$checksum" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Create nightly release
|
||||||
|
id: create_release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
body: |
|
||||||
|
${{ env.RELEASE_NOTES }}
|
||||||
|
|
||||||
|
SHA-256 fingerprints for the 4096-bit signing certificate:
|
||||||
|
```sh
|
||||||
|
${{ steps.checksum.outputs.checksum }}
|
||||||
|
```
|
||||||
|
|
||||||
|
To verify fingerprint:
|
||||||
|
```sh
|
||||||
|
apksigner verify --print-certs [path to APK file] | grep SHA-256
|
||||||
|
```
|
||||||
|
|
||||||
|
### Changelog
|
||||||
|
${{ steps.changelog.outputs.changes }}
|
||||||
|
tag_name: nightly
|
||||||
|
name: nightly
|
||||||
|
draft: false
|
||||||
|
prerelease: true
|
||||||
|
make_latest: false
|
||||||
|
files: |
|
||||||
|
${{ github.workspace }}/temp/**/*.apk
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
name: on-pr
|
name: on-pr
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
name: publish
|
name: publish
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
|
||||||
- cron: "4 3 * * *"
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
track:
|
track:
|
||||||
@@ -22,14 +23,13 @@ on:
|
|||||||
options:
|
options:
|
||||||
- none
|
- none
|
||||||
- prerelease
|
- prerelease
|
||||||
- nightly
|
|
||||||
- release
|
- release
|
||||||
default: release
|
default: release
|
||||||
required: true
|
required: true
|
||||||
tag_name:
|
tag_name:
|
||||||
description: "Tag name for release"
|
description: "Tag name for release"
|
||||||
required: false
|
required: false
|
||||||
default: nightly
|
default: 1.1.1
|
||||||
flavor:
|
flavor:
|
||||||
type: choice
|
type: choice
|
||||||
description: "Product flavor"
|
description: "Product flavor"
|
||||||
@@ -46,71 +46,37 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: standalone
|
default: standalone
|
||||||
|
|
||||||
env:
|
|
||||||
UPLOAD_DIR_ANDROID: android_artifacts
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_commits:
|
|
||||||
name: Check for New Commits
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
has_new_commits: ${{ steps.check.outputs.new_commits }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Check for new commits
|
|
||||||
id: check
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
|
||||||
run: |
|
|
||||||
NEW_COMMITS=$(git rev-list --count --after="$(date -Iseconds -d '23 hours ago')" ${{ github.sha }})
|
|
||||||
echo "new_commits=$NEW_COMMITS" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
build-fdroid:
|
build-fdroid:
|
||||||
if: ${{ inputs.release_type == 'release' || inputs.flavor == 'fdroid' }}
|
if: ${{ inputs.release_type == 'release' || inputs.flavor == 'fdroid' }}
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
build_type: ${{ inputs.release_type == '' && 'nightly' || inputs.release_type }}
|
build_type: ${{ inputs.release_type }}
|
||||||
flavor: fdroid
|
flavor: fdroid
|
||||||
|
|
||||||
build-standalone:
|
build-standalone:
|
||||||
if: ${{ inputs.release_type == 'release' || inputs.release_type == 'nightly' || inputs.release_type == 'prerelease' || inputs.flavor == 'standalone' }}
|
if: ${{ inputs.release_type == 'release' || inputs.release_type == 'prerelease' || inputs.flavor == 'standalone' }}
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
build_type: ${{ inputs.release_type == '' && 'nightly' || inputs.release_type }}
|
build_type: ${{ inputs.release_type }}
|
||||||
flavor: standalone
|
flavor: standalone
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs:
|
needs:
|
||||||
- check_commits
|
|
||||||
- build-standalone
|
- build-standalone
|
||||||
if: ${{ needs.check_commits.outputs.has_new_commits > 0 && inputs.release_type != 'none' }}
|
|
||||||
name: publish-github
|
name: publish-github
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
|
||||||
ref: main
|
ref: main
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update && sudo apt install -y gh apksigner
|
sudo apt update && sudo apt install -y gh apksigner
|
||||||
- name: Set TAG_NAME
|
|
||||||
run: |
|
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
||||||
echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
|
||||||
elif [ "${{ github.event_name }}" = "schedule" ]; then
|
|
||||||
echo "TAG_NAME=nightly" >> $GITHUB_ENV
|
|
||||||
echo "RELEASE_TYPE=nightly" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
- name: Set latest tag
|
- name: Set latest tag
|
||||||
uses: rickstaa/action-create-tag@v1
|
uses: rickstaa/action-create-tag@v1
|
||||||
id: tag_creation
|
id: tag_creation
|
||||||
@@ -126,22 +92,26 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
latest: true
|
latest: true
|
||||||
|
|
||||||
- name: Generate Changelog
|
- name: Generate Changelog
|
||||||
id: changelog
|
id: changelog
|
||||||
uses: requarks/changelog-action@v1
|
uses: requarks/changelog-action@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
toTag: ${{ github.event_name == 'schedule' && 'nightly' || steps.latest_release.outputs.tag_name }}
|
toTag: ${{ steps.latest_release.outputs.tag_name }}
|
||||||
fromTag: "latest"
|
fromTag: "latest"
|
||||||
writeToFile: false
|
writeToFile: false
|
||||||
|
|
||||||
- name: Make download dir
|
- name: Make download dir
|
||||||
run: mkdir ${{ github.workspace }}/temp
|
run: mkdir ${{ github.workspace }}/temp
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: android_artifacts_*
|
pattern: android_artifacts_*
|
||||||
path: ${{ github.workspace }}/temp
|
path: ${{ github.workspace }}/temp
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Set version release notes
|
- name: Set version release notes
|
||||||
if: ${{ inputs.release_type == 'release' }}
|
if: ${{ inputs.release_type == 'release' }}
|
||||||
run: |
|
run: |
|
||||||
@@ -151,36 +121,22 @@ jobs:
|
|||||||
echo "$RELEASE_NOTES" >> $GITHUB_ENV
|
echo "$RELEASE_NOTES" >> $GITHUB_ENV
|
||||||
echo "EOF" >> $GITHUB_ENV
|
echo "EOF" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: On nightly release notes
|
|
||||||
if: ${{ contains(env.TAG_NAME, 'nightly') }}
|
|
||||||
run: |
|
|
||||||
echo "RELEASE_NOTES=Nightly build for the latest development version of the app." >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: On prerelease release notes
|
- name: On prerelease release notes
|
||||||
if: ${{ inputs.release_type == 'prerelease' }}
|
if: ${{ inputs.release_type == 'prerelease' }}
|
||||||
run: |
|
run: |
|
||||||
echo "RELEASE_NOTES=Testing version of app for specific feature." >> $GITHUB_ENV
|
echo "RELEASE_NOTES=Testing version of app for specific feature." >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Delete previous release
|
- name: Get checksum
|
||||||
if: ${{ contains(env.TAG_NAME, 'nightly') || inputs.release_type == 'prerelease' }}
|
|
||||||
uses: ClementTsang/delete-tag-and-release@v0.4.0
|
|
||||||
with:
|
|
||||||
tag_name: ${{ env.TAG_NAME }}
|
|
||||||
delete_release: true
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get checksums
|
|
||||||
id: checksum
|
id: checksum
|
||||||
run: |
|
run: |
|
||||||
checksums=""
|
file_path=$(find ${{ github.workspace }}/temp -type f -iname "*.apk" | head -n 1)
|
||||||
for file_path in $(find ${{ github.workspace }}/temp -type f -iname "*.apk"); do
|
if [ -z "$file_path" ]; then
|
||||||
checksum=$(apksigner verify -print-certs $file_path | grep -Po "(?<=SHA-256 digest:) .*" | tr -d "[:blank:]")
|
echo "No APK file found"
|
||||||
checksums="$checksums\n$file_path: $checksum"
|
exit 1
|
||||||
done
|
fi
|
||||||
echo "checksum<<EOF" >> $GITHUB_OUTPUT
|
checksum=$(apksigner verify --print-certs "$file_path" | grep -Po "(?<=SHA-256 digest:) .*" | tr -d "[:blank:]")
|
||||||
echo -e "$checksums" >> $GITHUB_OUTPUT
|
echo "checksum=$checksum" >> $GITHUB_OUTPUT
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
@@ -200,13 +156,13 @@ jobs:
|
|||||||
|
|
||||||
### Changelog
|
### Changelog
|
||||||
${{ steps.changelog.outputs.changes }}
|
${{ steps.changelog.outputs.changes }}
|
||||||
tag_name: ${{ env.TAG_NAME }}
|
tag_name: ${{ github.event.inputs.tag_name }}
|
||||||
name: ${{ env.TAG_NAME }}
|
name: ${{ github.event.inputs.tag_name }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: ${{ inputs.release_type == 'prerelease' || inputs.release_type == '' || inputs.release_type == 'nightly' }}
|
prerelease: ${{ inputs.release_type == 'prerelease' }}
|
||||||
make_latest: ${{ inputs.release_type == 'release' }}
|
make_latest: ${{ inputs.release_type == 'release' }}
|
||||||
files: |
|
files: |
|
||||||
${{ github.workspace }}/temp/*
|
${{ github.workspace }}/temp/**/*.apk
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
@@ -224,7 +180,7 @@ jobs:
|
|||||||
event-type: fdroid-update
|
event-type: fdroid-update
|
||||||
|
|
||||||
publish-play:
|
publish-play:
|
||||||
if: ${{ inputs.track != 'none' && inputs.track != '' }}
|
if: ${{ inputs.track != 'none' }}
|
||||||
name: Publish to Google Play
|
name: Publish to Google Play
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -87,7 +87,8 @@ fun SupportScreen(viewModel: SupportViewModel = hiltViewModel(), appViewModel: A
|
|||||||
},
|
},
|
||||||
confirmText = {
|
confirmText = {
|
||||||
Text(
|
Text(
|
||||||
if (BuildConfig.FLAVOR != Constants.STANDALONE_FLAVOR) stringResource(R.string.download)
|
if (BuildConfig.FLAVOR != Constants.STANDALONE_FLAVOR)
|
||||||
|
stringResource(R.string.download)
|
||||||
else stringResource(R.string.download_and_install)
|
else stringResource(R.string.download_and_install)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user