-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (67 loc) · 1.84 KB
/
release.yaml
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
name: Create release
on:
push:
tags: ['v*']
jobs:
test:
uses: ./.github/workflows/test.yaml
pypi-publish:
name: Publish docopt.sh to PyPI
needs: [test]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: orbit-online/git-release@v1
id: tag
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: .devcontainer/post.sh
- name: Set version
run: poetry version ${{ steps.tag.outputs.tag }}
- name: Build
run: poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.8
docopt-lib-release:
needs: [test]
name: Create docopt-lib.sh GitHub Release
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: orbit-online/git-release@v1
id: tag
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Create release assets
id: assets
run: |
.devcontainer/post.sh
poetry version ${{ steps.tag.outputs.tag }}
poetry install
version=$(.venv/bin/docopt.sh --version)
printf "version=%s\n" "$version" >> $GITHUB_OUTPUT
mkdir dist
cp README.adoc LICENSE dist/
.venv/bin/docopt.sh generate-library >dist/docopt-lib.sh
printf '{
"name": "docopt-lib.sh",
"version": "%s"
}' "$version" >dist/upkg.json
- uses: orbit-online/upkg-release@v1
with:
working-directory: dist
version: ${{ steps.assets.outputs.version }}
paths: docopt-lib.sh README.adoc LICENSE