Skip to content

Commit c5ecf5e

Browse files
authored
Merge pull request #13 from avcopan/dev
Add release workflow
2 parents a968c26 + a8a9be8 commit c5ecf5e

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: release
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- closed
7+
8+
permissions:
9+
contents: write # needed for pushing tags/commits & creating releases
10+
11+
jobs:
12+
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+
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
42+
43+
# Create GitHub Release
44+
- name: Create Release
45+
uses: actions/create-release@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
tag_name: ${{ github.ref_name }}
50+
release_name: "Release ${{ github.ref_name }}"

0 commit comments

Comments
 (0)