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 c2bc879
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 25 deletions.
41 changes: 38 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,47 @@ 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: |
version=$(grep '^version:' pubspec.yaml | awk '{print $2}')
version_code=$(echo $version | sed 's/.*+//')
new_version="${NEW_RELEASE}+$((version_code + 1))"
sed -i "s/^version: .*/version: ${new_version}/" 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 }}
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]" -m "$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 "--prerelease")

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
20 changes: 10 additions & 10 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ packages:
dependency: transitive
description:
name: _flutterfire_internals
sha256: "5a0296da7ae717ffb7444dee8439ca25ac80e162a345b933aa57f0a4a48dca2c"
sha256: "71c01c1998c40b3af1944ad0a5f374b4e6fef7f3d2df487f3970dbeadaeb25a1"
url: "https://pub.dev"
source: hosted
version: "1.3.45"
version: "1.3.46"
_macros:
dependency: transitive
description: dart
Expand Down Expand Up @@ -458,10 +458,10 @@ packages:
dependency: "direct main"
description:
name: firebase_core
sha256: e59141ff83e70a9ba571a1f8733c5598cf57e6e68037ab185581d7fc0a436738
sha256: "2438a75ad803e818ad3bd5df49137ee619c46b6fc7101f4dbc23da07305ce553"
url: "https://pub.dev"
source: hosted
version: "3.7.0"
version: "3.8.0"
firebase_core_platform_interface:
dependency: transitive
description:
Expand All @@ -482,26 +482,26 @@ packages:
dependency: transitive
description:
name: firebase_messaging
sha256: a988c6ab37fa5a6abf2f8087a44b765e058848ace6f3253fb1602d1d44a63747
sha256: "4d0968ecb860d7baa15a6e2af3469ec5b0d959e51c59ce84a52b0f7632a4aa5a"
url: "https://pub.dev"
source: hosted
version: "15.1.4"
version: "15.1.5"
firebase_messaging_platform_interface:
dependency: transitive
description:
name: firebase_messaging_platform_interface
sha256: "66aa477277baf2430904096234dd2095ad2e0248d0bfefc1b11695e68bf1790e"
sha256: a2cb3e7d71d40b6612e2d4e0daa0ae759f6a9d07f693f904d14d22aadf70be10
url: "https://pub.dev"
source: hosted
version: "4.5.47"
version: "4.5.48"
firebase_messaging_web:
dependency: transitive
description:
name: firebase_messaging_web
sha256: "8b590d8c421dc4f63a28c6b9690a050424c28b99a54886ded4510c0806237130"
sha256: "1554e190f0cd9d6fe59f61ae0275ac12006fdb78b07669f1a260d1a9e6de3a1f"
url: "https://pub.dev"
source: hosted
version: "3.9.3"
version: "3.9.4"
fish_repository:
dependency: "direct main"
description:
Expand Down

0 comments on commit c2bc879

Please sign in to comment.