Merge pull request #160 from urbanairship/release-6.2.3 #150
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+*" | |
| env: | |
| DEVELOPER_DIR: /Applications/Xcode_14.0.app/Contents/Developer | |
| FLUTTER_VERSION: 3.0.2 | |
| JAVA_VERSION: "12.x" | |
| JAVA_DISTRIBUTION: 'zulu' | |
| jobs: | |
| ci: | |
| runs-on: macos-12 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-java@v2 | |
| with: | |
| distribution: ${{ env.JAVA_DISTRIBUTION }} | |
| java-version: ${{ env.JAVA_VERSION }} | |
| - uses: subosito/flutter-action@d8687e6979e8ef66d2b2970e2c92c1d8e801d7bf | |
| with: | |
| flutter-version: ${{env.FLUTTER_VERSION}} | |
| - name: Run CI | |
| run: bash ./scripts/run_ci_tasks.sh | |
| release-plugin: | |
| runs-on: ubuntu-latest | |
| needs: [ ci ] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Get the version | |
| id: get_version | |
| run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
| - name: Get the release notes | |
| id: get_release_notes | |
| run: | | |
| VERSION=${{ steps.get_version.outputs.VERSION }} | |
| NOTES="$(awk "/## Version $VERSION/{flag=1;next}/## Version/{flag=0}flag" CHANGELOG.md)" | |
| NOTES="${NOTES//'%'/'%25'}" | |
| NOTES="${NOTES//$'\n'/'%0A'}" | |
| NOTES="${NOTES//$'\r'/'%0D'}" | |
| echo ::set-output name=NOTES::"$NOTES" | |
| - uses: actions/setup-java@v2 | |
| with: | |
| distribution: ${{ env.JAVA_DISTRIBUTION }} | |
| java-version: ${{ env.JAVA_VERSION }} | |
| - name: Flutter action | |
| uses: subosito/flutter-action@d8687e6979e8ef66d2b2970e2c92c1d8e801d7bf | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| - run: flutter pub get | |
| - name: Setup pub credentials | |
| run: | | |
| mkdir -p ~/.pub-cache | |
| cat <<EOF > ~/.pub-cache/credentials.json | |
| { | |
| "accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}", | |
| "refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}", | |
| "tokenEndpoint":"https://accounts.google.com/o/oauth2/token", | |
| "scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ], | |
| "expiration": ${{secrets.OAUTH_EXPIRATION }} | |
| } | |
| EOF | |
| cp ~/.pub-cache/credentials.json $PUB_CACHE/credentials.json | |
| - name: Publish Dart/Flutter package | |
| run: flutter pub publish -f | |
| - name: Github Release | |
| uses: actions/create-release@v1.0.1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.get_version.outputs.VERSION }} | |
| release_name: ${{ steps.get_version.outputs.VERSION }} | |
| body: ${{ steps.get_release_notes.outputs.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-12 | |
| needs: [ ci, release-plugin ] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Get the version | |
| id: get_version | |
| run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
| - uses: actions/setup-java@v2 | |
| with: | |
| distribution: ${{ env.JAVA_DISTRIBUTION }} | |
| java-version: ${{ env.JAVA_VERSION }} | |
| - name: Flutter action | |
| uses: subosito/flutter-action@d8687e6979e8ef66d2b2970e2c92c1d8e801d7bf | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| - run: flutter pub get | |
| - name: Generate documentation | |
| run: bash ./scripts/docs.sh -g | |
| - uses: google-github-actions/setup-gcloud@v0 | |
| with: | |
| version: '351.0.0' | |
| service_account_email: ${{ secrets.GCP_SA_EMAIL }} | |
| service_account_key: ${{ secrets.GCP_SA_KEY }} | |
| - name: Upload docs to GoogleCloudPlatform | |
| run: | | |
| ./scripts/docs.sh -u ${GITHUB_REF/refs\/tags\//} doc/api | |
| - 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 }} |