-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Muhmud Ahmad
committed
Jan 10, 2024
1 parent
4c3c920
commit 1a919cf
Showing
3 changed files
with
48 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
on: | ||
push: | ||
branches: [main] | ||
name: Create Release PR | ||
jobs: | ||
prepare-release: | ||
if: "!contains(github.event.head_commit.message, 'chore: Release')" # Skip merges from releases | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Configure Git | ||
run: | | ||
git config --global user.name GitHub Actions | ||
git config user.email [email protected] | ||
- uses: knope-dev/[email protected] | ||
with: | ||
version: 0.13.0 | ||
- run: knope prepare-release --verbose | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
continue-on-error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,11 @@ | ||
name: Release | ||
on: workflow_dispatch | ||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: [main] | ||
jobs: | ||
prepare-release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
sha: ${{ steps.commit.outputs.sha }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Fetch entire history (for conventional commits) | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Configure Git | ||
run: | | ||
git config --global user.name GitHub Actions | ||
git config user.email [email protected] | ||
- name: Install Knope | ||
uses: knope-dev/[email protected] | ||
with: | ||
version: 0.11.0 | ||
- run: knope prepare-release --verbose | ||
name: Update versioned files and changelog | ||
- name: Store commit | ||
id: commit | ||
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
|
||
build-artifacts: | ||
needs: prepare-release | ||
if: github.head_ref == 'release' && github.event.pull_request.merged == true | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -60,20 +39,18 @@ jobs: | |
if-no-files-found: error | ||
|
||
release: | ||
needs: [build-artifacts, prepare-release] | ||
needs: [build-artifacts] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.prepare-release.outputs.sha }} | ||
- uses: actions/[email protected] | ||
with: | ||
path: release | ||
merge-multiple: true | ||
- name: Install Knope | ||
uses: knope-dev/[email protected] | ||
with: | ||
version: 0.11.0 | ||
version: 0.13.0 | ||
- run: knope release --verbose | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters