Skip to content

Commit 8ceb134

Browse files
authored
Merge pull request #16 from avcopan/dev
Add release workflow
2 parents 85e5927 + 58942d0 commit 8ceb134

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
- 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 }}"

0 commit comments

Comments
 (0)