Skip to content

Commit 6dfe15b

Browse files
authored
Merge pull request #23 from avcopan/dev
Further clean up release workflow
2 parents 595b804 + 64916c0 commit 6dfe15b

1 file changed

Lines changed: 18 additions & 17 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,44 @@ permissions:
99

1010
jobs:
1111
release:
12+
name: Release on merged PR
1213
if: >
1314
github.event.pull_request.merged == true &&
1415
contains(github.event.pull_request.labels.*.name, 'bump:patch')
1516
runs-on: ubuntu-latest
1617

1718
steps:
18-
# 1. Check out the base branch to ensure we have the merged code
19+
# 1. Checkout the merged code
1920
- name: Checkout merged code
2021
uses: actions/checkout@v4
2122
with:
22-
ref: ${{ github.event.pull_request.base.ref }}
23+
ref: ${{ github.event.pull_request.merge_commit_sha }}
2324
fetch-depth: 0
2425

25-
# 2. Set up Pixi environment
26-
- name: Set up Pixi
26+
# 2. Setup environment
27+
- name: Install Pixi
2728
uses: prefix-dev/setup-pixi@v0.8.9
2829

29-
# 3. Configure Git identity for committing
30-
- name: Set Git identity
30+
- name: Fetch bot identity
31+
id: bot
32+
uses: actions/bot-details@v1
33+
34+
- name: Configure git for committing
3135
run: |
32-
git config user.name 'github-actions[bot]'
33-
git config user.email 'github-actions[bot]@users.noreply.github.com'
36+
git config user.name "${{ steps.bot.outputs.name }}"
37+
git config user.email "${{ steps.bot.outputs.email }}"
3438
35-
# 4. Bump the version
39+
# 3. Bump version + read version
3640
- name: Bump version (patch)
37-
run: |
38-
pixi run bumpver update --patch
41+
run: pixi run bumpver update --patch
3942

40-
# 5. Extract version
41-
- name: Get version tag
43+
- name: Get bumped version
4244
id: version
4345
run: |
44-
tag=$(pixi run current-version)
45-
echo "tag=${tag}" >> $GITHUB_OUTPUT
46+
echo "tag=$(pixi run current-version)" >> "$GITHUB_OUTPUT"
4647
47-
# 6. Create GitHub Release
48+
# 4. Create release
4849
- name: Create GitHub Release
4950
uses: softprops/action-gh-release@v2
5051
with:
51-
tag_name: ${{ steps.version.outputs.tag }}
52+
tag_name: ${{ steps.version.outputs.tag }}

0 commit comments

Comments
 (0)