-
Notifications
You must be signed in to change notification settings - Fork 21
71 lines (58 loc) · 1.86 KB
/
release.yaml
File metadata and controls
71 lines (58 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: release
on:
pull_request_target:
types: [closed]
permissions:
contents: write
jobs:
release:
if: >
github.event.pull_request.merged == true && (
contains(github.event.pull_request.labels.*.name, 'release:patch') ||
contains(github.event.pull_request.labels.*.name, 'release:major')
)
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
# 1. Checkout the merged code
- name: Checkout merged code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 0
# 2. Setup environment
- name: Set up Pixi
uses: prefix-dev/setup-pixi@v0.8.9
- name: Fetch bot identity
id: bot
uses: raven-actions/bot-details@v1
- name: Configure git for committing
run: |
git config user.name "${{ steps.bot.outputs.name }}"
git config user.email "${{ steps.bot.outputs.email }}"
# 3. Bump version
- name: Bump version (patch)
if: contains(github.event.pull_request.labels.*.name, 'release:patch')
run: pixi run -e build bumpver update --patch
- name: Bump version (major)
if: contains(github.event.pull_request.labels.*.name, 'release:major')
run: pixi run -e build bumpver update --major
- name: Get version
id: version
run: |
echo "tag=$(pixi run current-version)" >> "$GITHUB_OUTPUT"
# 4. Build and upload conda package
- name: Build
run: |
pixi build
- name: Upload
run: |
pixi run -e build upload
env:
ANACONDA_API_KEY: ${{ secrets.ANACONDA_API_KEY }}
# 5. Create release
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}