Skip to content

chore: bump up to 5.3.2 (#424) #9

chore: bump up to 5.3.2 (#424)

chore: bump up to 5.3.2 (#424) #9

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: macos-latest
artifact_prefix: macos
target: x86_64-apple-darwin
- os: ubuntu-latest
artifact_prefix: linux
target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
- uses: wasabeef/import-asdf-tool-versions-action@v1.0.1
id: asdf
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.asdf.outputs.flutter }}
channel: stable
cache: true
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ steps.asdf.outputs.dart }}
- name: Set environment
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Get dependencies
run: |
dart pub global activate melos
melos bootstrap
- name: Running build
run: |
cd packages/command/
mkdir -p bin/${{ matrix.target }}
dart compile exe bin/flutter_gen_command.dart -o bin/${{ matrix.target }}/fluttergen
- name: Packaging final binary
shell: bash
run: |
cd packages/command/bin/${{ matrix.target }}
tar czvf fluttergen-${{ matrix.artifact_prefix }}.tar.gz fluttergen
shasum -a 256 fluttergen-${{ matrix.artifact_prefix }}.tar.gz > fluttergen-${{ matrix.artifact_prefix }}.sha256
- name: Releasing assets
uses: softprops/action-gh-release@v1
with:
files: |
packages/command/bin/${{ matrix.target }}/fluttergen-${{ matrix.artifact_prefix }}.tar.gz
packages/command/bin/${{ matrix.target }}/fluttergen-${{ matrix.artifact_prefix }}.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: sha256
path: packages/command/bin/${{ matrix.target }}/fluttergen-${{ matrix.artifact_prefix }}.sha256
# - name: Setup credentials
# if: startsWith(matrix.os, 'ubuntu')
# run: |
# mkdir -p ~/.pub-cache
# cat <<eof > ~/.pub-cache/credentials.json
# {
# "accesstoken":"${{ secrets.CREDENTIALS_ACCESS_TOKEN }}",
# "refreshtoken":"${{ secrets.CREDENTIALS_REFRESH_TOKEN }}",
# "idtoken":"${{ secrets.CREDENTIALS_ID_TOKEN }}",
# "tokenendpoint":"https://accounts.google.com/o/oauth2/token",
# "scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
# "expiration": 1664440281637
# }
# eof
#
# - name: Publish to pub.dev
# if: startsWith(matrix.os, 'ubuntu')
# run: |
# melos publish --no-dry-run --yes
update:
name: Update Homebrew tap
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
with:
name: sha256
- id: version
run: echo "::set-output name=version::${GITHUB_REF##*/}"
- id: checksum
shell: bash
run: |
echo ::set-output name=sha256_linux::$(cat fluttergen-linux.sha256 | awk '{ print $1 }')
echo ::set-output name=sha256_macos::$(cat fluttergen-macos.sha256 | awk '{ print $1 }')
- uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PAT_FLUTTERGEN }}
repository: FlutterGen/homebrew-tap
event-type: update-tap
client-payload: '{ "sha256_linux": "${{ steps.checksum.outputs.sha256_linux }}", "sha256_macos": "${{ steps.checksum.outputs.sha256_macos }}", "version": "${{ steps.version.outputs.version }}" }'