Skip to content

Release

Release #128

Workflow file for this run

name: Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (no actual publish)'
required: false
type: boolean
default: false
version:
description: 'Version number (e.g., 1.0.0)'
required: true
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
FLUTTER_VERSION: 3.24.3
JAVA_VERSION: "17.x"
JAVA_DISTRIBUTION: 'zulu'
jobs:
ci:
runs-on: macos-14-xlarge
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: ${{env.FLUTTER_VERSION}}
- name: Run CI
run: bash ./scripts/run_ci_tasks.sh
prepare-release:
runs-on: ubuntu-latest
needs: [ ci ]
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
release_notes: ${{ steps.get_release_notes.outputs.NOTES }}
steps:
- uses: actions/checkout@v3
- name: Get the version
id: get_version
run: |

Check failure on line 50 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / Release

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 50, Col: 14): Unexpected symbol: 'ref#refs/tags/'. Located at position 8 within expression: github.ref#refs/tags/ .github/workflows/release.yml (Line: 123, Col: 14): Unexpected symbol: 'ref#refs/tags/'. Located at position 8 within expression: github.ref#refs/tags/
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
VERSION="${{ github.ref#refs/tags/ }}"
else
VERSION="${{ github.event.inputs.version }}"
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Get the release notes
id: get_release_notes
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
delimiter="$(openssl rand -hex 8)"
{
echo "NOTES<<${delimiter}"
awk "/## Version $VERSION/{flag=1;next}/## Version/{flag=0}flag" CHANGELOG.md
echo "${delimiter}"
} >> $GITHUB_OUTPUT
publish:
needs: [ prepare-release ]
if: ${{ github.event.inputs.dry_run != 'true' }}
permissions:
id-token: write # Required for authentication using OIDC
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
working-directory: .
publish-check:
needs: [ prepare-release ]
if: ${{ github.event.inputs.dry_run == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- name: Install dependencies
run: dart pub get
- name: Publish dry run
run: dart pub publish --dry-run
create-github-release:
runs-on: ubuntu-latest
needs: [ prepare-release, publish ]
if: ${{ github.event.inputs.dry_run != 'true' }}
steps:
- uses: actions/checkout@v3
- name: Github Release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.prepare-release.outputs.version }}
release_name: ${{ needs.prepare-release.outputs.version }}
body: ${{ needs.prepare-release.outputs.release_notes }}
draft: false
prerelease: false
- name: Slack Notification
uses: homoluctus/slatify@master
if: failure()
with:
type: ${{ job.status }}
job_name: "Failed to release Flutter :("
url: ${{ secrets.MOBILE_SLACK_WEBHOOK }}
release-docs:
runs-on: macos-14-xlarge
needs: [ publish ]
if: ${{ github.event.inputs.dry_run != 'true' }}
steps:
- uses: actions/checkout@v3
- name: Get the version
id: get_version
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
VERSION="${{ github.ref#refs/tags/ }}"
else
VERSION="${{ github.event.inputs.version }}"
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- uses: actions/setup-java@v2
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- name: Flutter action
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Setup GCP Auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Build & Package docs
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
flutter pub get
bash ./scripts/docs.sh -gp $VERSION doc/api
- name: Upload docs
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
gsutil cp doc/$VERSION.tar.gz gs://ua-web-ci-prod-docs-transfer/libraries/flutter/$VERSION.tar.gz
- name: Slack Notification
uses: homoluctus/slatify@master
with:
type: ${{ job.status }}
job_name: ":raised_hands: Airship Flutter Plugin Released! :raised_hands:"
url: ${{ secrets.MOBILE_SLACK_WEBHOOK }}