publish-nym-vpn-android #38
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release-nym-vpn-android-play | ||
on: | ||
schedule: | ||
- cron: "4 3 * * *" | ||
workflow_dispatch: | ||
inputs: | ||
track: | ||
type: choice | ||
description: "Fastlane release track" | ||
options: | ||
- none | ||
- internal | ||
- alpha | ||
- beta | ||
- production | ||
default: alpha | ||
required: true | ||
tag_name: | ||
description: "Tag name for release" | ||
required: false | ||
default: nightly-vpn-android | ||
release_type: | ||
type: choice | ||
description: "GitHub release type" | ||
options: | ||
- none | ||
- prerelease | ||
- release | ||
default: release | ||
required: true | ||
push: | ||
tags: | ||
- 'nym-vpn-android-v*.*.*' | ||
jobs: | ||
build-nym-vpn-android: | ||
if: ${{ inputs.release_type != 'none' }} | ||
uses: ./.github/workflows/build-nym-vpn-android.yml | ||
Check failure on line 41 in .github/workflows/publish-nym-vpn-android.yml GitHub Actions / release-nym-vpn-android-playInvalid workflow file
|
||
publish-github: | ||
if: ${{ inputs.release_type != 'none' }} | ||
needs: | ||
- build-nym-vpn-android | ||
runs-on: ubuntu-22.04-arc | ||
defaults: | ||
run: | ||
working-directory: nym-vpn-android | ||
steps: | ||
- name: Get version code | ||
run: | | ||
version_code=$(grep "VERSION_CODE" buildSrc/src/main/kotlin/Constants.kt | awk '{print $5}' | tr -d '\n') | ||
echo "VERSION_CODE=$version_code" >> $GITHUB_ENV | ||
- name: Set version release notes | ||
run: | | ||
release_notes=$(cat ${{ github.workspace }}/fastlane/metadata/android/en-US/changelogs/${{ env.VERSION_CODE }}.txt) | ||
echo "RELEASE_NOTES=$release_notes" >> $GITHUB_ENV | ||
# Setup TAG_NAME, which is used as a general "name" | ||
- if: github.event_name == 'workflow_dispatch' | ||
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV | ||
- if: github.event_name == 'schedule' | ||
run: | | ||
echo "TAG_NAME=nightly-android" >> $GITHUB_ENV | ||
echo "RELEASE_NOTES=Nightly build of the latest development version of the android client." >> $GITHUB_ENV | ||
- if: github.event_name == 'push' | ||
run: echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV | ||
- name: Delete old nightly | ||
if: ${{ contains(env.TAG_NAME, 'nightly') }} | ||
run: | | ||
gh release delete nightly-android --yes || true | ||
- name: Create release with fastlane changelog notes | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
body: ${{ env.RELEASE_NOTES }} | ||
tag_name: ${{ env.TAG_NAME }} | ||
name: ${{ github.TAG_NAME}} | ||
draft: false | ||
make_latest: ${{ inputs.release_type == 'release' }} | ||
prerelease: ${{ inputs.release_type == 'prerelease' || inputs.release_type == '' }} | ||
files: | | ||
${{ github.workspace }}/${{ env.UPLOAD_DIR_ANDROID_APK }} | ||
- name: Dispatch update for fdroid repo | ||
if: inputs.release_type == 'release' | ||
uses: peter-evans/repository-dispatch@v3 | ||
with: | ||
token: ${{ secrets.PAT }} | ||
repository: nymtech/fdroid | ||
event-type: fdroid-update | ||
publish-play: | ||
if: ${{ inputs.track != 'none' && inputs.track != '' }} | ||
runs-on: ubuntu-22.04-arc | ||
defaults: | ||
run: | ||
working-directory: nym-vpn-android | ||
steps: | ||
- name: Deploy with fastlane | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.2' # Not needed with a .ruby-version file | ||
bundler-cache: true | ||
- name: Distribute app to fastlane track 🚀 | ||
run: (cd ${{ github.workspace }} && bundle install && bundle exec fastlane ${{ inputs.track }}) | ||