Skip to content

Release

Release #2

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
next_version:
default: "0.0.0"
description: "The next version to be released"
required: false
stable:
default: false
description: "Is this version stable?"
type: boolean
required: false
jobs:
update-changelog:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CI_PAT }}
fetch-depth: 0
- uses: subosito/flutter-action@v2.16.0
with:
flutter-version-file: app/pubspec.yaml
- name: Setup git
id: setup
run: |
SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)"
[[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]]
SETONIX_VERSION="${BASH_REMATCH[1]}"
echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV
SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}"
echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV
git config --global user.email "ci@linwood.dev"
git config --global user.name "Linwood CI"
- name: Update changelog
run: |
git fetch
git pull origin
dart pub get -C tools
dart run tools/set_version.dart --build-number keep ${{ env.SETONIX_VERSION }} --changelog
git add .
git commit -m "Add changelog of v${{ env.SETONIX_VERSION }}"
git push origin
- name: Merge in develop
if: ${{ github.ref == 'refs/heads/main' }}
run: |
git fetch
git checkout develop
git pull origin develop
git merge main --strategy-option ours
git push origin develop
release:
runs-on: ubuntu-24.04
needs:
- update-changelog
outputs:
version: ${{ steps.setup.outputs.SETONIX_VERSION }}
build_number: ${{ steps.setup.outputs.SETONIX_BUILD_NUMBER }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CI_PAT }}
ref: ${{ github.ref }}
fetch-depth: 0
- uses: subosito/flutter-action@v2.16.0
with:
flutter-version-file: app/pubspec.yaml
- name: Setup git
id: setup
shell: bash
run: |
SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)"
[[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]]
SETONIX_VERSION="${BASH_REMATCH[1]}"
echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV
echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_OUTPUT
SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}"
echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV
echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_OUTPUT
git config --global user.email "ci@linwood.dev"
git config --global user.name "Linwood CI"
- name: Create tag
run: |
SETONIX_VERSION="${{ env.SETONIX_VERSION }}"
git tag -fa v${{ env.SETONIX_VERSION }} -m "Release ${SETONIX_VERSION}"
git push origin v${SETONIX_VERSION} -f
- uses: actions/checkout@v4
with:
token: ${{ secrets.CI_PAT }}
fetch-depth: 0
- name: Create release
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ github.event.inputs.stable != 'true' }}
tag_name: v${{ env.SETONIX_VERSION }}
name: v${{ env.SETONIX_VERSION }}
token: ${{ secrets.CI_PAT }}
body_path: metadata/en-US/changelogs/${{ env.SETONIX_BUILD_NUMBER }}.txt
- name: Retag stable
if: ${{ github.event.inputs.stable == 'true' || github.ref == 'refs/heads/main' }}
run: |
git tag -fa stable -m "Find all stable releases here"
git push origin HEAD:stable -f
- name: Retag nightly
if: ${{ github.event.inputs.stable != 'true' && github.ref == 'refs/heads/develop' }}
run: |
git tag -fa nightly -m "Find all nightly releases here"
git push origin HEAD:nightly -f
- name: Merge in main
if: ${{ github.ref == 'refs/heads/develop' && github.event.inputs.stable == 'true' }}
run: |
git fetch
git checkout main
git pull origin main
git merge develop --strategy-option ours
git push origin main
set-next-version:
runs-on: ubuntu-24.04
needs:
- update-changelog
- release
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CI_PAT }}
fetch-depth: 0
- uses: subosito/flutter-action@v2.16.0
with:
flutter-version-file: app/pubspec.yaml
- name: Setup git
id: setup
run: |
SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)"
[[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]]
SETONIX_VERSION="${BASH_REMATCH[1]}"
echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV
SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}"
echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV
git config --global user.email "ci@linwood.dev"
git config --global user.name "Linwood CI"
- name: Set next version
run: |
git fetch
git pull origin
dart pub get -C tools
dart run tools/set_version.dart --build-number increment ${{ github.event.inputs.next_version }} --no-changelog
git add .
git commit -m "Update Version to ${{ github.event.inputs.next_version }}"
git push origin
- name: Merge develop
if: ${{ github.ref == 'refs/heads/main' }}
run: |
git fetch
git checkout develop
git pull origin develop
git merge main --strategy-option ours
git push origin develop
bump-version:
runs-on: ubuntu-24.04
needs:
- update-changelog
- release
- set-next-version
steps:
- name: Checkout main
if: ${{ github.ref == 'refs/heads/develop' }}
uses: actions/checkout@v4
with:
token: ${{ secrets.CI_PAT }}
fetch-depth: 0
ref: main
- name: Checkout develop
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/checkout@v4
with:
token: ${{ secrets.CI_PAT }}
fetch-depth: 0
ref: develop
- name: Setup git
id: setup
run: |
SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)"
[[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]]
SETONIX_VERSION="${BASH_REMATCH[1]}"
echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV
SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}"
echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV
git config --global user.email "ci@linwood.dev"
git config --global user.name "Linwood CI"
- uses: subosito/flutter-action@v2.16.0
with:
flutter-version-file: app/pubspec.yaml
- name: Bump version
run: |
git fetch
git pull origin
dart pub get -C tools
dart run tools/set_version.dart --build-number increment ${{ env.SETONIX_VERSION }} --no-changelog
git add .
git commit -m "Bump version"
git push origin
- name: Update develop
if: ${{ github.ref == 'refs/heads/develop' }}
run: |
git fetch
git checkout develop
git pull origin
git merge main --strategy-option ours
git push origin develop
notify:
runs-on: ubuntu-24.04
needs: [release]
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CI_PAT }}
- name: Get information
shell: bash
run: |
SETONIX_VERSION_REGEX="version:\s(.+)\+(.+)"
[[ $(grep -E "${SETONIX_VERSION_REGEX}" app/pubspec.yaml) =~ ${SETONIX_VERSION_REGEX} ]]
SETONIX_VERSION="${BASH_REMATCH[1]}"
echo "SETONIX_VERSION=${SETONIX_VERSION}" >> $GITHUB_ENV
SETONIX_BUILD_NUMBER="${BASH_REMATCH[2]}"
echo "SETONIX_BUILD_NUMBER=${SETONIX_BUILD_NUMBER}" >> $GITHUB_ENV
echo 'SETONIX_CHANGELOG<<EOF' >> $GITHUB_ENV
cat metadata/en-US/changelogs/${SETONIX_BUILD_NUMBER}.txt >> $GITHUB_ENV
echo '' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Discord Webhook Action
uses: tsickert/discord-webhook@v6.0.0
if: ${{ github.event.inputs.stable == 'true' || github.ref == 'refs/heads/main' }}
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
embed-title: ${{ env.SETONIX_VERSION }}
embed-description: ${{ env.SETONIX_CHANGELOG }}
embed-url: https://github.com/LinwoodDev/Setonix/releases/tag/v${{ env.SETONIX_VERSION }}
content: |
Version ${{ env.SETONIX_VERSION }} released!
Download it here: https://setonix.world/downloads
https://github.com/LinwoodDev/Setonix/releases/tag/v${{ env.SETONIX_VERSION }}
- name: Discord Webhook Action
uses: tsickert/discord-webhook@v6.0.0
if: ${{ github.event.inputs.stable == 'false' && github.ref == 'refs/heads/develop' }}
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
embed-title: ${{ env.SETONIX_VERSION }}
embed-description: ${{ env.SETONIX_CHANGELOG }}
embed-url: https://github.com/LinwoodDev/Setonix/releases/tag/v${{ env.SETONIX_VERSION }}
content: |
Pre-release version ${{ env.SETONIX_VERSION }} released!
Download it here: https://setonix.world/downloads
Please note that this is a pre-release version and is not intended for production use.
Read more about it here: https://setonix.world/nightly