forked from wandb/weave
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.11 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
name: publish-pypi-release
on:
workflow_dispatch:
inputs:
is_test:
description: "Use Test Pypi"
required: true
type: boolean
default: true
jobs:
build-release:
name: Build and publish to pypi
runs-on: ubuntu-8core
timeout-minutes: 10
environment:
name: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: "18.x"
- run: |
pip install build twine
./build_dist.py
if [[ -n "$(git status weave/frontend/sha1.txt --porcelain)" ]]
then
echo "::error cannot publish release, commited SHA does not match build SHA"
exit 1
fi
- name: upload test distribution
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ inputs.is_test }}
with:
repository-url: https://test.pypi.org/legacy/
- name: upload distribution
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ !inputs.is_test }}