Skip to content

Commit

Permalink
Put bump_version into its own workflow (#966)
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierPaquet-Rapold authored Apr 12, 2024
1 parent 3990ede commit b2c70bd
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 32 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/devtools-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- '*.md'
- 'android/fastlane/**'
- 'ios/fastlane/**'
types: [ labeled ]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -50,34 +49,3 @@ jobs:
'This PR exceeds the recommended size of 1000 lines.
Please make sure you are NOT addressing multiple issues with one PR.
Note this PR might be rejected due to its size.’
bump_version:
name: Bump app version using PR labels
runs-on: ubuntu-latest
# The version label can't contain a ":" because of the YAML specification
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'version - Unversioned') }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PTA }}
- name: Bump version using labels
uses: apomalyn/[email protected]
with:
file_path: 'pubspec.yaml'
reference_branch: 'master'
commit: 'false'
- name: Commit versioned files
id: commit_version
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: "*.yaml"
commit_user_name: github-actions[bot]
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com
commit_message: "[BOT] Applying version."
add_options: '-u'

# Fail workflow, because new commit will execute workflow
- if: ${{ steps.commit_version.outputs.changes_detected == 'true' }}
name: Fail workflow if version commit
run: |
echo 'Version changed, running bot commit workflow'
exit 1
44 changes: 44 additions & 0 deletions .github/workflows/versionning-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Dev tools workflow
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '.gitignore'
- '.metadata'
- '.github/**'
- '.githooks/**'
- '*.md'
- 'android/fastlane/**'
- 'ios/fastlane/**'
types: [ labeled ]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
##############################################################
# Setup
##############################################################
bump_version:
name: Bump app version using PR labels
runs-on: ubuntu-latest
# The version label can't contain a ":" because of the YAML specification
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'version - Unversioned') }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PTA }}
- name: Bump version using labels
uses: apomalyn/[email protected]
with:
file_path: 'pubspec.yaml'
reference_branch: 'master'
commit: 'false'
- name: Commit versioned files
id: commit_version
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: "*.yaml"
commit_user_name: github-actions[bot]
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com
commit_message: "[BOT] Applying version."
add_options: '-u'

0 comments on commit b2c70bd

Please sign in to comment.