v2.0.20 #81
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 App | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
description: Version | |
required: true | |
changelog: | |
type: string | |
description: What's new ? | |
required: true | |
track: | |
required: true | |
description: Release track | |
type: choice | |
options: | |
- "production" | |
- "beta" | |
default: "production" | |
jobs: | |
version-update: | |
if: github.event.pull_request.head.repo.fork == false | |
runs-on: ubuntu-latest | |
outputs: | |
track: ${{ steps.variables.track }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.BOT_PAT }} | |
ref: main | |
- name: Defines variables according to triggers | |
id: variables | |
run: | | |
if [ "${{ github.event_name }}" == "release" ] | |
then | |
CHANGELOG="${{ github.event.release.body }}" | |
CHANGELOG="${CHANGELOG//'%'/'%25'}" | |
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" | |
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" | |
echo "::set-output name=version::${{ github.event.release.tag_name }}" | |
echo "::set-output name=changelog::${CHANGELOG}" | |
fi | |
if [ "${{ github.event_name }}" == "workflow_dispatch" ] | |
then | |
CHANGELOG="${{ github.event.inputs.changelog }}" | |
CHANGELOG="${CHANGELOG//'%'/'%25'}" | |
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" | |
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" | |
echo "::set-output name=version::${{ github.event.inputs.version }}" | |
echo "::set-output name=changelog::${CHANGELOG}" | |
fi | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
cache: "npm" | |
cache-dependency-path: .github/workflows/scripts/package-lock.json | |
- name: Updates version and changelog | |
run: npm ci | |
working-directory: .github/workflows/scripts/ | |
- name: Updates version and changelog | |
run: npm run version-update -- --version=${{ steps.variables.outputs.version }} --changelog="${{ steps.variables.outputs.changelog }}" | |
working-directory: .github/workflows/scripts/ | |
- name: Add changes to commit | |
run: | | |
git add pubspec.yaml | |
git add CHANGELOG.md | |
git add fastlane | |
- name: Check for modified files | |
id: git-check | |
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) | |
- name: Push changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Updating pubspec and changelogs to version ${{steps.variables.outputs.version}} | |
commit_user_name: LittleLightBot | |
commit_user_email: LittleLightBot@users.noreply.github.com | |
publish-google-play: | |
uses: ./.github/workflows/publish-google-play.yml | |
needs: [version-update] | |
secrets: inherit | |
publish-ios: | |
uses: ./.github/workflows/publish-ios.yml | |
needs: [version-update] | |
secrets: inherit | |
publish-macos: | |
uses: ./.github/workflows/publish-macos.yml | |
needs: [version-update] | |
secrets: inherit | |
publish-windows: | |
uses: ./.github/workflows/publish-windows.yml | |
needs: [version-update] | |
secrets: inherit | |
update-translations: | |
uses: ./.github/workflows/update-translations.yml | |
needs: [version-update] | |
secrets: inherit |