-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (65 loc) · 2.07 KB
/
publish.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
# This workflows builds the library and publishes it on PyPI.
name: Build & Publish
on:
workflow_run:
workflows: [Test]
types: [completed]
branches: [main]
jobs:
python:
name: Publish Python Package
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"] # use lowest supported Python version
defaults:
run:
working-directory: python
environment:
name: pypi
url: https://pypi.org/p/geoengine-openapi-client
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
- name: Build a binary wheel and a source tarball
run: |
pip install --upgrade build
python3 -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python/dist/ # does not use `run.working-directory`
typescript:
name: Publish TypeScript Package
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.20.x] # use lowest supported Node version
defaults:
run:
working-directory: typescript
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}