-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (58 loc) · 1.75 KB
/
create-release-from-tag.yml
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
72
73
74
name: Create release from tag
on:
push:
tags:
- v[0-9]*
env:
CARGO_TERM_COLOR: always
jobs:
prepare:
name: Prepare for release
runs-on: ubuntu-latest
outputs:
mapiproxy_version: ${{ steps.version_number.outputs.mapiproxy_version }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build x helper
run: cargo build --example x
- name: Determine version number
id: version_number
run: cargo run --example x -- version mapiproxy_version= >>"$GITHUB_OUTPUT"
- name: Verify tag name against version number
run: cargo run --example x -- checktag ${{ github.ref_name }}
- name: Generate release notes
run: cargo run --example x -- relnotes >relnotes.md
- name: Store release notes
uses: actions/upload-artifact@v4
with:
name: relnotes
path: relnotes.md
if-no-files-found: error
build:
# note the ./. it's essential
uses: ./.github/workflows/create-binaries.yml
release:
name: Create release
permissions:
contents: write
runs-on: ubuntu-latest
needs: [prepare, build]
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- run: |
ls -R
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
test -n "${{ github.ref_name }}"
gh release create ${{ github.ref_name }} \
--title 'mapiproxy ${{ needs.prepare.outputs.mapiproxy_version }}' \
--notes-file relnotes.md \
mapiproxy*.tar.gz mapiproxy*.zip