Skip to content

Release

Release #59

Workflow file for this run

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@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
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@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
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@81e9d935c883d0b210363ab89cf05f3894778450 # master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
#- uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # master
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}