mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
This now bumps the version number in de.wger.flutter.metainfo.xml, which is something we were not doing before...
58 lines
1.9 KiB
YAML
58 lines
1.9 KiB
YAML
name: Bump version
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
app_version:
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
determine_version:
|
|
name: Create tag
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Checkout application
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # needed to push changes
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Common flutter setup
|
|
uses: ./.github/actions/flutter-common
|
|
|
|
- name: Setup uv
|
|
uses: astral-sh/setup-uv@v5
|
|
|
|
- name: Validate version
|
|
run: |
|
|
RELEASE_VERSION="${{ inputs.app_version }}"
|
|
if [[ ! "${{ inputs.app_version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
echo "Error: Input version '${{ inputs.app_version }}' is not in X.Y.Z format."
|
|
exit 1
|
|
fi
|
|
|
|
# In order to make sure the build number is the same across all platforms,
|
|
# increase to the next multiple of 10. This is needed because the iOS process
|
|
# is a bit more brittle and might need to be repeated if the App needs
|
|
# to be re-submitted.
|
|
- name: Bump pubspec version
|
|
run: |
|
|
CURRENT_BUILD=$(flutter pub run cider version | cut -d '+' -f 2)
|
|
NEXT_BUILD=$(( (CURRENT_BUILD / 10 + 1) * 10 ))
|
|
flutter pub run cider version ${{ inputs.app_version }}+${NEXT_BUILD}
|
|
|
|
- name: Bump flatpak version
|
|
run: |
|
|
cd flatpak
|
|
uv run bump-flatpak-version.py ${{ inputs.app_version }}
|
|
|
|
- name: Tag release and commit pubspec
|
|
run: |
|
|
git config user.name Github-Actions
|
|
git config user.email github-actions@github.com
|
|
git add pubspec.yaml flatpak/de.wger.flutter.metainfo.xml
|
|
git commit -m "Bump version to ${{ inputs.app_version }}"
|
|
git tag ${{ inputs.app_version }}
|
|
git push origin HEAD:master --tags
|