Release #106
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
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
android: | |
description: 'Android' | |
default: 'true' | |
type: boolean | |
ios: | |
description: 'iOS' | |
default: 'true' | |
type: boolean | |
permissions: | |
contents: write | |
concurrency: | |
group: "release" | |
cancel-in-progress: true | |
jobs: | |
version: | |
name: Generate version | |
runs-on: ubuntu-latest | |
outputs: | |
name: ${{ steps.version.outputs.name }} | |
number: ${{ steps.version.outputs.number }} | |
changelog: ${{ steps.version.outputs.changelog }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Read version from pubspec | |
uses: pietrobolcato/action-read-yaml@1.1.0 | |
id: pubspec | |
with: | |
config: pubspec.yaml | |
- name: Get latest version | |
id: latest | |
uses: WyriHaximus/github-action-get-previous-tag@v1 | |
- name: Parse latest version | |
id: parser | |
uses: booxmedialtd/ws-action-parse-semver@v1.4.7 | |
with: | |
input_string: ${{ steps.latest.outputs.tag }} | |
- name: Generate version | |
id: version | |
env: | |
pubspec: ${{ steps.pubspec.outputs.version }} | |
release: ${{ steps.latest.outputs.tag }} | |
major: ${{ steps.parser.outputs.major }} | |
minor: ${{ steps.parser.outputs.minor }} | |
patch: ${{ steps.parser.outputs.patch }} | |
run: | | |
next=`expr $patch + 1` | |
v=`[[ $pubspec > $release ]] && echo $pubspec || echo "$major.$minor.$next"` | |
echo "name=$v" >> $GITHUB_OUTPUT | |
n=`expr $GITHUB_RUN_NUMBER + 70` | |
echo "number=$n" >> $GITHUB_OUTPUT | |
echo "Version $v ($n)" | |
- name: Generate changelog | |
run: | | |
{ | |
echo 'changelog<<EOF' | |
git log --format="• %s" `git describe --abbrev=0 --tags`..HEAD | |
echo EOF | |
} >> "$GITHUB_OUTPUT" | |
Android: | |
if: inputs.android | |
uses: ./.github/workflows/release_android.yml | |
needs: version | |
secrets: inherit | |
with: | |
name: "${{ needs.version.outputs.name }}" | |
number: "${{ needs.version.outputs.number }}" | |
iOS: | |
if: inputs.ios | |
uses: ./.github/workflows/release_ios.yml | |
needs: version | |
secrets: inherit | |
with: | |
name: "${{ needs.version.outputs.name }}" | |
number: "${{ needs.version.outputs.number }}" |