Release v0.12.0 (#404) #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
concurrency: release | |
on: | |
push: | |
tags: | |
- v* | |
permissions: {} | |
jobs: | |
build-signer: | |
name: Build tuf-on-ci signer | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 | |
with: | |
python-version: '3.12' | |
- name: Install build dependencies | |
run: python3 -m pip install -c build/build-constraints.txt build | |
- name: Build release changelog, signer wheel & source tarball | |
run: | | |
PIP_CONSTRAINT=build/build-constraints.txt python3 -m build --sdist --wheel --outdir dist/ signer/ | |
awk "/## $GITHUB_REF_NAME/{flag=1; next} /## v/{flag=0} flag" docs/CHANGELOG.md > changelog | |
- name: Store build artifacts | |
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | |
with: | |
name: build-artifacts | |
path: | | |
dist | |
changelog | |
release-pypi: | |
name: Release Signer on PyPI | |
runs-on: ubuntu-latest | |
needs: build-signer | |
environment: release | |
permissions: | |
id-token: write # to authenticate as Trusted Publisher to pypi.org | |
steps: | |
- name: Fetch build artifacts | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: build-artifacts | |
- name: Publish binary wheel and source tarball on PyPI | |
if: github.repository == 'theupdateframework/tuf-on-ci' | |
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0 | |
release-gh: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: release-pypi | |
permissions: | |
contents: write # to modify GitHub releases | |
steps: | |
- name: Fetch build artifacts | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: build-artifacts | |
- name: Make a GitHub release | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
with: | |
script: | | |
fs = require('fs') | |
res = await github.rest.repos.createRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
name: '${{ github.ref_name }}', | |
tag_name: '${{ github.ref }}', | |
body: fs.readFileSync('changelog', 'utf8'), | |
}) | |
fs.readdirSync('dist/').forEach(file => { | |
github.rest.repos.uploadReleaseAsset({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: res.data.id, | |
name: file, | |
data: fs.readFileSync('dist/' + file), | |
}); | |
}); |