-
Notifications
You must be signed in to change notification settings - Fork 31
128 lines (122 loc) · 3.39 KB
/
release.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
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
118
119
120
121
122
123
124
125
126
127
128
name: Release
on:
release:
types:
- published
jobs:
checks:
name: Run checks workflow
uses: alan-cooney/CircuitsVis/.github/workflows/checks.yml@main
semver-parser:
name: Parse the semantic version from the release
runs-on: ubuntu-latest
steps:
- name: Parse semver string
id: semver_parser
uses: booxmedialtd/[email protected]
with:
input_string: ${{ github.event.release.tag_name }}
outputs:
major: "${{ steps.semver_parser.outputs.major }}"
minor: "${{ steps.semver_parser.outputs.minor }}"
patch: "${{ steps.semver_parser.outputs.patch }}"
semver: "${{ steps.semver_parser.outputs.fullversion }}"
release-react:
name: Release React Node JS package to NPMJS
needs:
- checks
- semver-parser
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
env:
working-directory: react
defaults:
run:
working-directory: react
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: yarn
- name: Build
run: yarn build
- name: Set the version
run: yarn version --new-version ${{needs.semver-parser.outputs.semver}} --no-git-tag-version --no-commit-hooks
- name: Publish to NPMJS
id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
package: ${{env.working-directory}}/package.json
check-version: true
release-python:
name: Release Python package to PyPi
needs:
- checks
- semver-parser
- release-react
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v3
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
- name: Poetry config
run: poetry self add 'poethepoet[poetry_plugin]'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'poetry'
- name: Install dependencies
run: poetry install --with dev
- name: Set the version
run: poetry version ${{needs.semver-parser.outputs.semver}}
- name: Build
run: poetry build
- name: Publish
run: poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
publish-storybook:
name: Publish docs to GitHub Pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs:
- release-react
runs-on: ubuntu-latest
env:
working-directory: react
defaults:
run:
working-directory: react
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v2
- uses: actions/checkout@v3
- name: Install dependencies
run: yarn
- name: Build
run: yarn build
- name: Build storybook
run: yarn build-storybook
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: 'react/storybook-static'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1