Skip to content

Release

Release #140

Workflow file for this run

name: Release
on: workflow_dispatch
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.changelog.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
id: changelog
run: |
{
echo 'changelog<<EOF'
git log --format="• %s" `git describe --abbrev=0 --tags`..HEAD
echo EOF
} >> "$GITHUB_OUTPUT"
android:
name: Android
uses: ./.github/workflows/android.yml
needs: version
secrets: inherit
with:
name: "${{ needs.version.outputs.name }}"
number: "${{ needs.version.outputs.number }}"
changelog: "${{ needs.version.outputs.changelog }}"
ios:
name: iOS
uses: ./.github/workflows/ios.yml
needs: version
secrets: inherit
with:
name: "${{ needs.version.outputs.name }}"
number: "${{ needs.version.outputs.number }}"
changelog: "${{ needs.version.outputs.changelog }}"
linux_x86_64:
name: Linux x86-64
uses: ./.github/workflows/linux_x86_64.yml
needs: version
secrets: inherit
with:
name: "${{ needs.version.outputs.name }}"
web:
name: Web
uses: ./.github/workflows/web.yml
needs: version
secrets: inherit
with:
name: "${{ needs.version.outputs.name }}"
create_release:
name: Create release
runs-on: ubuntu-latest
needs: [ version, android, ios, linux_x86_64, web ]
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- uses: softprops/action-gh-release@v1
env:
BUILD_NAME: ${{ needs.version.outputs.name }}
with:
tag_name: "$BUILD_NAME"
name: "tudo $BUILD_NAME"
generate_release_notes: true
files: |
app-release.aab
app-release.apk
tudo.ipa
tudo_linux_x86_64.tar.gz
tudo_web.zip