-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (81 loc) 路 2.38 KB
/
gh-release-create.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
75
76
77
78
79
80
81
name: gh release create
on:
workflow_dispatch:
inputs:
draft:
description: ""
type: boolean
default: false
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
poe-build:
strategy:
fail-fast: false
matrix:
include:
# Use older Ubuntu distro to force older glibc
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: arm64-apple-darwin
- os: macos-13
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# - run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# Can't use cache because macos-latest and macos-13 have different
# architecture but have the same cache key.
# cache: poetry
- run: pip install pipx
- run: pipx install poetry poethepoet
- run: poetry install
- run: poe build
- uses: actions/upload-artifact@v4
with:
name: bikeshed-${{ matrix.target }}
path: dist/bikeshed
get-version:
outputs:
version: ${{ steps.yq.outputs.result }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: yq
uses: mikefarah/yq@master
with:
cmd: yq .tool.poetry.version pyproject.toml
gh-release-create:
needs: [poe-build, get-version]
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- shell: bash -ex {0}
run: |
for f in *; do
if [[ $f == *windows* ]]; then
wd="$PWD"
(cd "$f" && zip -r "$wd/$f.zip" .)
else
wd="$PWD"
(cd "$f" && tar -czf "$wd/$f.tar.gz" .)
fi
done
- run: |
gh release create \
"v$VERSION" \
$DRAFT_FLAG \
--generate-notes \
*.tar.gz *.zip
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
VERSION: ${{ needs.get-version.outputs.version }}
DRAFT_FLAG: ${{ (inputs.draft && '--draft') || '' }}