Skip to content

Merge pull request #178 from jku/release-v0.5.0 #6

Merge pull request #178 from jku/release-v0.5.0

Merge pull request #178 from jku/release-v0.5.0 #6

Workflow file for this run

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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
with:
python-version: '3.11'
- name: Install build dependencies
run: python3 -m pip install build
- name: Build binary wheel and source tarball
run: python3 -m build --sdist --wheel --outdir dist/ signer/
- name: Store build artifacts
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8
with:
name: signer-artifacts
path: dist
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@6b208ae046db98c579e8a3aa621ab581ff575935
with:
name: signer-artifacts
path: dist
- name: Publish binary wheel and source tarball on PyPI
if: github.repository == 'theupdateframework/tuf-on-ci'
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
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@6b208ae046db98c579e8a3aa621ab581ff575935
with:
name: signer-artifacts
path: dist
- name: Make a GitHub release
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
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: 'See [CHANGELOG.md](https://github.com/' +
context.repo.owner + '/' + context.repo.repo +
'/blob/${{ github.ref_name }}/docs/CHANGELOG.md) for details.'
})
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),
});
});