-
Notifications
You must be signed in to change notification settings - Fork 1
117 lines (115 loc) · 4.51 KB
/
Copy pathpublish.yml
File metadata and controls
117 lines (115 loc) · 4.51 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Publish packages & docs
on:
release:
types: ["created"]
jobs:
publish-npm-package:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC
contents: read
defaults:
run:
working-directory: ./web-components
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
registry-url: "https://registry.npmjs.org"
cache: npm
cache-dependency-path: web-components/package-lock.json
- run: npm run setup
- run: npm version --no-git-tag-version ${{ github.event.release.tag_name }}
- run: npm run build
- id: prerelease
if: contains(github.event.release.tag_name, 'alpha') || contains(github.event.release.tag_name, 'beta')
run: npm publish --tag next
- if: steps.prerelease.conclusion == 'skipped'
run: npm publish
# build local report
- run: npm run build:local-report
# upload local report assets
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: local-report-css
path: ./web-components/dist/local-report/local-report.css
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: local-report-js
path: ./web-components/dist/local-report/local-report.js
publish-pypi-package:
needs: [publish-npm-package]
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
defaults:
run:
working-directory: ./python-client
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.13
cache: "pip"
- run: pip install -r requirements.txt
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/uv
key: uv-3.13-${{ hashFiles('uv.lock') }}
- run: uv sync --frozen --all-extras
# download local report assets
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: ./python-client/src/arakawa/resources/html_templates/
pattern: local-report-*
merge-multiple: true
# confirm local report assets are present
- run: |
test -e ./src/arakawa/resources/html_templates/local-report.css
test -e ./src/arakawa/resources/html_templates/local-report.js
- run: uv build
- name: publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
# NOTE: need to use absolute path since working-directory is not respected...
packages-dir: ./python-client/dist/
publish-docs:
needs: [publish-npm-package, publish-pypi-package]
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # fetch all commits/branches
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.13
cache: pip
- run: pip install -r requirements.txt
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/uv
key: uv-3.13-${{ hashFiles('uv.lock') }}
- run: uv sync --frozen --all-extras
- name: Reinstall from ../python-client
run: uv sync --reinstall-package arakawa
- run: AR_VERSION=${{ github.event.release.tag_name }} ./nbbuild.sh
- run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
# NOTE: tag name is semver
- run: |
VERSION=$(uv run python convert_to_py_version.py "${{ github.event.release.tag_name }}")
if echo "$VERSION" | grep -q "[A-Za-z]"; then
echo "beta/alpha version detected"
uv run mike deploy "$VERSION" --update-aliases --push
else
echo "stable version detected"
uv run mike deploy "$VERSION" latest --update-aliases --push
uv run mike set-default --push latest
fi