Skip to content

Commit f09bb0b

Browse files
authored
Merge pull request #20 from avcopan/dev
Separate version bump from release workflow
2 parents 66fcef4 + 08ea46b commit f09bb0b

File tree

2 files changed

+48
-46
lines changed

2 files changed

+48
-46
lines changed

.github/workflows/bump.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: bump
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- closed
7+
8+
permissions:
9+
contents: write # needed for pushing tags/commits
10+
11+
jobs:
12+
bump:
13+
# Only run if PR was merged AND has the bump label
14+
if: >
15+
github.event.pull_request.merged == true &&
16+
contains(github.event.pull_request.labels.*.name, 'bump:patch')
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
# We check out the BASE branch — this is now the merged code — SAFE
22+
- name: Checkout merged code
23+
uses: actions/checkout@v4
24+
with:
25+
ref: ${{ github.event.pull_request.base.ref }}
26+
fetch-depth: 0
27+
28+
# Environment
29+
- name: Set up Pixi
30+
uses: prefix-dev/setup-pixi@v0.8.9
31+
32+
# Git identity
33+
- name: Set Git identity
34+
run: |
35+
git config user.name 'github-actions[bot]'
36+
git config user.email 'github-actions[bot]@users.noreply.github.com'
37+
38+
# Bump version
39+
- name: Bump version (patch)
40+
run: |
41+
pixi run bumpver update --patch

.github/workflows/release.yml

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,15 @@
11
name: release
22

33
on:
4-
pull_request_target:
5-
types:
6-
- closed
7-
8-
permissions:
9-
contents: write # needed for pushing tags/commits & creating releases
4+
push:
5+
tags:
6+
- "*"
107

118
jobs:
129
release:
13-
# Only run if PR was merged AND has the bump label
14-
if: >
15-
github.event.pull_request.merged == true &&
16-
contains(github.event.pull_request.labels.*.name, 'bump:patch')
17-
1810
runs-on: ubuntu-latest
19-
2011
steps:
21-
# We check out the BASE branch — this is now the merged code — SAFE
22-
- name: Checkout merged code
23-
uses: actions/checkout@v4
24-
with:
25-
ref: ${{ github.event.pull_request.base.ref }}
26-
fetch-depth: 0
27-
28-
# Environment
29-
- name: Set up Pixi
30-
uses: prefix-dev/setup-pixi@v0.8.9
31-
32-
# Git identity
33-
- name: Set Git identity
34-
run: |
35-
git config user.name 'github-actions[bot]'
36-
git config user.email 'github-actions[bot]@users.noreply.github.com'
37-
38-
# Bump version
39-
- name: Bump version (patch)
40-
run: |
41-
pixi run bumpver update --patch
42-
43-
- name: Get version tag
44-
id: version
45-
run: echo "value=$(pixi run current-version)" >> $GITHUB_OUTPUT
46-
47-
# Create GitHub Release
48-
- name: Create Release
49-
uses: actions/create-release@v1
50-
env:
51-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
with:
53-
tag_name: ${{ steps.version.outputs.value }}
54-
release_name: "Release ${{ steps.version.outputs.value }}"
12+
- name: Checkout
13+
uses: actions/checkout@v5
14+
- name: Release
15+
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)