-
Notifications
You must be signed in to change notification settings - Fork 287
82 lines (73 loc) · 2.75 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Version (e.g., v0.24.0)"
required: true
commit:
description: "Commit (e.g., 92b44e1)"
required: true
permissions:
contents: read
jobs:
release:
permissions:
contents: write
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- run: |
set -x -e
COMMIT=$(git rev-parse --quiet --verify ${{ github.event.inputs.commit }})
if [[ "$(git tag -l ${{ github.event.inputs.version }})" == "${{ github.event.inputs.version }}" ]]; then
echo "${{ github.event.inputs.version }} already released"
exit 1
fi
VERSION=${{ github.event.inputs.version }}
docker pull tfsigio/candidate:${VERSION:1}
docker create -it --name storage tfsigio/candidate:${VERSION:1} bash
docker cp storage:/wheelhouse .
docker cp storage:/wheelhouse.sha256 .
docker cp storage:/wheelhouse.commit .
docker cp storage:/wheelhouse.version .
sha256sum wheelhouse/*.whl | sort -u | diff wheelhouse.sha256 -
mv wheelhouse dist
if [[ "${COMMIT}" != "$(cat wheelhouse.commit)" ]]; then
echo "${COMMIT} != $(cat wheelhouse.commit)"
exit 1
fi
if [[ "${VERSION}" != "v$(cat wheelhouse.version)" ]]; then
echo "${VERSION} != v$(cat wheelhouse.version)"
exit 1
fi
python3 tools/release/note_take.py ${VERSION}
echo "::set-output name=tag::${VERSION}"
echo "::set-output name=name::TensorFlow I/O ${VERSION:1}"
echo "::set-output name=commit::${COMMIT}"
id: info
- run: |
set -x -e
echo ${{ steps.info.outputs.tag }}
echo ${{ steps.info.outputs.name }}
echo ${{ steps.info.outputs.commit }}
cat CURRENT.md
- uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v2.0.6
with:
body_path: CURRENT.md
name: ${{ steps.info.outputs.name }}
tag_name: ${{ steps.info.outputs.tag }}
target_commitish: ${{ steps.info.outputs.commit }}
draft: true
- uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
#- uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # master
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}