-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.05 KB
/
release.yml
File metadata and controls
40 lines (34 loc) · 1.05 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify tag matches distro.toml version
run: |
TOML_VERSION="$(grep '^version' distro.toml | sed -E 's/^[^=]+=\s*"([^"]+)".*/\1/')"
TAG_VERSION="${GITHUB_REF_NAME#v}"
if [[ "$TAG_VERSION" != "$TOML_VERSION" ]]; then
echo "ERROR: tag ${GITHUB_REF_NAME} does not match distro.toml version ${TOML_VERSION}"
exit 1
fi
- name: Build release archive
run: |
VERSION="${GITHUB_REF_NAME}"
zip "managed-python-${VERSION}.zip" \
distro.toml install.sh install.ps1 install.bat setup.py
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION="${GITHUB_REF_NAME}"
gh release create "$VERSION" \
"managed-python-${VERSION}.zip" \
--title "$VERSION" \
--generate-notes