Merge pull request #97 from jku/release-v0.1.0 #2
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@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 | |
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 | |
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@9bc31d5ccc31df68ecc42ccf4149144866c47d8a | |
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@b7f401de30cb6434a1e19f805ff006643653240e | |
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@9bc31d5ccc31df68ecc42ccf4149144866c47d8a | |
with: | |
name: signer-artifacts | |
path: dist | |
- name: Make a GitHub release | |
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 | |
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), | |
}); | |
}); |