-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #231 from urbanairship/release-workflow-update
Release workflow update
- Loading branch information
Showing
1 changed file
with
21 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,13 @@ 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 | ||
|
||
env: | ||
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer | ||
|
@@ -30,6 +37,8 @@ jobs: | |
release-plugin: | ||
runs-on: ubuntu-latest | ||
needs: [ ci ] | ||
permissions: | ||
id-token: write # Required for authentication using OIDC | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
|
@@ -60,26 +69,18 @@ jobs: | |
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 | ||
mkdir -p ~/Library/Application\ Support/dart/ | ||
cp ~/.pub-cache/credentials.json ~/Library/Application\ Support/dart/pub-credentials.json | ||
cp ~/.pub-cache/credentials.json $PUB_CACHE/credentials.json || true | ||
- name: Publish Dart/Flutter package | ||
run: flutter pub publish -f | ||
- name: Publish to pub.dev | ||
if: ${{ !inputs.dry_run }} | ||
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 | ||
|
||
- name: Dry Run Publish to pub.dev | ||
if: ${{ inputs.dry_run }} | ||
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 | ||
with: | ||
dry-run: true | ||
|
||
- name: Github Release | ||
if: ${{ !inputs.dry_run }} | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -101,6 +102,7 @@ jobs: | |
release-docs: | ||
runs-on: macos-14-xlarge | ||
needs: [ ci, release-plugin ] | ||
if: ${{ !inputs.dry_run }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
|
@@ -143,4 +145,4 @@ jobs: | |
with: | ||
type: ${{ job.status }} | ||
job_name: ":raised_hands: Airship Flutter Plugin Released! :raised_hands:" | ||
url: ${{ secrets.MOBILE_SLACK_WEBHOOK }} | ||
url: ${{ secrets.MOBILE_SLACK_WEBHOOK }} |