Skip to content

Commit

Permalink
Fix update-changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Aug 5, 2022
1 parent 46be829 commit a31d8c5
Showing 1 changed file with 50 additions and 4 deletions.
54 changes: 50 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,50 @@ on:
required: false

jobs:
update-changelog:
runs-on: ubuntu-22.04
strategy:
matrix:
branch:
- develop
- main
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.CI_PAT }}
ref: ${{ matrix.branch }}
- name: Get flutter version
run: |
FLUTTER_VERSION=$(cat app/FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable" # or: 'beta' or 'dev'
- name: Setup git
id: setup
run: |
BUTTERFLY_VERSION_REGEX="version:\s(.+)\+(.+)"
[[ $(grep -E "${BUTTERFLY_VERSION_REGEX}" app/pubspec.yaml) =~ ${BUTTERFLY_VERSION_REGEX} ]]
BUTTERFLY_VERSION="${BASH_REMATCH[1]}"
echo "BUTTERFLY_VERSION=${BUTTERFLY_VERSION}" >> $GITHUB_ENV
BUTTERFLY_BUILD_NUMBER="${BASH_REMATCH[2]}"
echo "BUTTERFLY_BUILD_NUMBER=${BUTTERFLY_BUILD_NUMBER}" >> $GITHUB_ENV
git config --global user.email "[email protected]"
git config --global user.name "Linwood CI"
- name: Update changelog
run: |
git fetch
git pull origin ${{ matrix.branch }}
dart pub get -C tools
dart run tools/set_version.dart --build-number keep ${{ env.BUTTERFLY_VERSION }} --changelog
git add .
git commit -m "Add changelog of v${{ github.event.inputs.next_version }}"
git push origin ${{ matrix.branch }}
release:
runs-on: ubuntu-22.04
needs:
- update-changelog
outputs:
build_number: ${{ steps.setup.outputs.build_number }}
steps:
Expand Down Expand Up @@ -90,6 +132,7 @@ jobs:
update-version:
runs-on: ubuntu-22.04
needs:
- update-changelog
- release
steps:
- uses: actions/checkout@v3
Expand All @@ -115,7 +158,7 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "Linwood CI"
- name: Set next version
if: ${{ github.event.inputs.stable != 'true' || github.ref != 'refs/heads/develop' }}
if: ${{ github.event.inputs.stable != 'true' || github.ref != 'refs/heads/develop' }}
run: |
git fetch
git pull origin
Expand All @@ -129,6 +172,7 @@ jobs:
runs-on: ubuntu-22.04
needs:
- release
- update-changelog
- update-version
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -160,7 +204,7 @@ jobs:
git commit -m "Update version number"
git push origin main
- name: Merge develop in main
if: ${{ github.event.inputs.stable == 'true' && github.ref == 'refs/heads/develop' }}
if: ${{ github.event.inputs.stable == 'true' && github.ref == 'refs/heads/develop' }}
run: |
git fetch
git pull
Expand All @@ -181,6 +225,7 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- release
- update-changelog
- update-version
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -234,9 +279,10 @@ jobs:
git push origin develop
set-next-version:
runs-on: ubuntu-22.04
if: ${{ github.event.inputs.stable == 'true' && github.ref == 'refs/heads/develop' }}
if: ${{ github.event.inputs.stable == 'true' && github.ref == 'refs/heads/develop' }}
needs:
- release
- update-changelog
- update-version
- update-main
steps:
Expand Down Expand Up @@ -325,4 +371,4 @@ jobs:
# run: fastlane deploy
# if: ${{ !github.event.inputs.stable }}
# env:
# PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }}
# PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }}

0 comments on commit a31d8c5

Please sign in to comment.