Skip to content

release

release #13

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
input_version:
type: choice
description: What type of release?
options:
- patch
- minor
- major
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release_publish:
runs-on: ubuntu-latest
environment: pub.dev # is configured in repo settings with secrets
permissions:
contents: write
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
- name: Debug inputs
run: |
echo "Type of release:${{ github.event.inputs.input_version }} from user ${GITHUB_ACTOR}"
git config --list
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Setup Flutter SDK
uses: flutter-actions/setup-flutter@v3
with:
channel: stable
version: latest
cache: true
cache-sdk: true
cache-key: flutter-cache
- name: Update Flutter SDK
run: flutter upgrade
- name: Install dependencies
run: flutter pub get
- name: Cache node_modules
id: node-modules
uses: actions/cache@v4
with:
path: |
node_modules
test-app/node_modules
.yarn/cache
key: node-modules
- name: Import GPG key
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: GPG user IDs
run: |
echo "fingerprint: ${{ steps.import-gpg.outputs.fingerprint }}"
echo "keyid: ${{ steps.import-gpg.outputs.keyid }}"
echo "name: ${{ steps.import-gpg.outputs.name }}"
echo "email: ${{ steps.import-gpg.outputs.email }}"
- name: Install dependencies
run: npm i
- uses: flutter-actions/setup-pubdev-credentials@v1
- name: git config
run: |
git config user.name "${{ steps.import-gpg.outputs.name }}"
git config user.email "${{ steps.import-gpg.outputs.email }}"
git config --list
- name: Run release-it
run: npx release-it ${{ github.event.inputs.input_version }} --ci -V
env:
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Attest
uses: actions/attest-build-provenance@v1
with:
subject-path: "${{ github.workspace }}/*.tgz"