Skip to content

Commit

Permalink
ci: trying out something new
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayerOrnstein committed Nov 17, 2024
1 parent 25c8688 commit 4be40bb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 15 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,42 @@ jobs:
with:
fetch-tags: true
token: ${{ secrets.GH_TOKEN }}

- name: Semantic Release
id: semantic
uses: cycjimmy/[email protected]
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
with:
extra_plugins: |
@semantic-release/git
semantic-release-pub
semantic_version: 24.2.0

- name: Bump version
if: steps.semantic.outputs.new_release_published == 'true'
env:
NEW_RELEASE: ${{ steps.semantic.outputs.new_release_version }}
run: |
sed -i -E "s/^version: ([0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\.]+)?)(\+([0-9]+))?$/version: $NEW_RELEASE+\$((\4+1))/e" pubspec.yaml
- name: Commit and push changes
if: steps.semantic.outputs.new_release_published == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NOTES: ${{ steps.semantic.outputs.new_release_notes}}
NEW_RELEASE: ${{ steps.semantic.outputs.new_release_version }}
HUSKY: 0
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add pubspec.yaml
git commit -m "chore(release): $NEW_RELEASE [skip ci]\n\n$RELEASE_NOTES" --no-verify
git push
- name: Create Release
if: steps.semantic.outputs.new_release_published == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NOTES: ${{ steps.semantic.outputs.new_release_notes }}
NEW_RELEASE: ${{ steps.semantic.outputs.new_release_version }}
PRERELEASE: ${{ contains(steps.semantic.outputs.new_release_channel, 'beta') }}
run: gh release create v$NEW_RELEASE --notes $RELEASE_NOTES --target ${{ github.sha }} $([ "$PRERELEASE" = "true" ] && echo "-p")

10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
run: flutter pub get
- name: Unit Test app
run: flutter test --coverage
build_test:
needs: [test]
secrets: inherit
uses: ./.github/workflows/build_test.yml
# build_test:
# needs: [test]
# secrets: inherit
# uses: ./.github/workflows/build_test.yml
release:
if: github.event_name != 'pull_request'
needs: [test, build_test]
needs: [test]
secrets: inherit
uses: ./.github/workflows/release.yml
7 changes: 0 additions & 7 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ plugins:
release: patch
- - "@semantic-release/release-notes-generator"
- presets: conventionalcommits
- "@semantic-release/github"
- - "semantic-release-pub"
- publishPub: false
updateBuildNumber: true
- - "@semantic-release/git"
- assets: ["pubspec.yaml"]
message: "chore(release): ${nextRelease.version}"
branches:
- name: master
- name: beta
Expand Down

0 comments on commit 4be40bb

Please sign in to comment.