Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Release

# ignore: RiskyTriggers
on:
workflow_dispatch:

Expand All @@ -8,18 +9,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
with:
fetch-depth: 0

- name: Get application token
id: get_token
uses: peter-murray/workflow-application-token-action@8e1ba3bf1619726336414f1014e37f17fbadf1db # v2.1.0
with:
application_id: ${{ secrets.CI_APP_ID }}
application_private_key: ${{ secrets.CI_APP_PRIVATE_KEY }}

- name: Get version
id: version
uses: paulhatch/semantic-version@ea50fff3e41d24bb283f22b7343c4b3a314282fb #v5.0.2

- name: Get Latest Release
id: latest-release
uses: pozetroninc/github-action-get-latest-release@d1dafdb6e338bdab109e6afce581a01858680dfb # v0.7.0
Expand All @@ -28,6 +32,7 @@ jobs:
repo: charlatan
excludes: prerelease, draft
token: ${{ github.token }}

- name: Generate release notes
id: release-notes
uses: mikepenz/release-changelog-builder-action@3a70419f3cc01ac7458a4fa44f09726475edfc6a # v3.4.0
Expand All @@ -37,29 +42,35 @@ jobs:
configuration: .github/workflows/release_changelog_configuration.json
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Setup dart
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f # v1.5.0

- name: Setup cider
run: dart pub global activate cider

- name: Update CHANGELOG and pubspec.yaml
run: |
cider version ${{ steps.version.outputs.version }}
cider version "${{ steps.version.outputs.version }}"
cat <(echo -e "## ${{ steps.version.outputs.version }} - $(date +%Y-%m-%d) \n\n${{ steps.release-notes.outputs.changelog }}\n\n") CHANGELOG.md > NEW_CHANGELOG.md
mv NEW_CHANGELOG.md CHANGELOG.md
git add CHANGELOG.md pubspec.yaml

- name: Create pull request
id: create_pull_request
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
with:
token: ${{ steps.get_token.outputs.token }}
branch: 'bot/prep-release-${{ steps.version.outputs.version }}'
title: 'chore(release): update CHANGELOG and pubspec.yaml for version `${{ steps.version.outputs.version }}` (NOBUMP)'
commit-message: 'chore(release): update CHANGELOG and pubspec.yaml for version `${{ steps.version.outputs.version }}`'
branch: "bot/prep-release-${{ steps.version.outputs.version }}"
title: "chore(release): update CHANGELOG and pubspec.yaml for version `${{ steps.version.outputs.version }}` (NOBUMP)"
commit-message: "chore(release): update CHANGELOG and pubspec.yaml for version `${{ steps.version.outputs.version }}`"
add-paths: |
CHANGELOG.md
pubspec.yaml
base: main

- name: Merge pull request
run: gh pr merge ${{ steps.create_pull_request.outputs.pull-request-number }} --squash --auto --delete-branch
# ignore: AutomaticMerge
run: gh pr merge "${{ steps.create_pull_request.outputs.pull-request-number }}" --squash --auto --delete-branch
env:
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
Loading