Skip to content

Bump actions/setup-python from 4.7.0 to 4.8.0 (#295) #65

Bump actions/setup-python from 4.7.0 to 4.8.0 (#295)

Bump actions/setup-python from 4.7.0 to 4.8.0 (#295) #65

Workflow file for this run

name: Release specification
on:
workflow_dispatch:
push:
branches: master
jobs:
make-release:
name: Make and publish spec release
runs-on: ubuntu-latest
permissions:
contents: write # required to publish (tag) a release
steps:
- name: Clone main
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa
with:
python-version: '3.10'
cache: 'pip'
- name: Get previous version
id: prevver
run: |
prev_version=`git tag | sort -V -r | head -n 1 | cut -c 2-`
echo "prev_version=$prev_version" >> $GITHUB_OUTPUT
- name: Get version
id: getver
run: |
spec_version=`grep -oP 'VERSION \K(\d+\.\d+\.\d+)' tuf-spec.md`
echo "spec_version=$spec_version" >> $GITHUB_OUTPUT
- name: Make release
if: steps.getver.outputs.spec_version != steps.prevver.outputs.prev_version
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.getver.outputs.spec_version }}
release_name: v${{ steps.getver.outputs.spec_version }}
body: Specification release v${{ steps.getver.outputs.spec_version }}
- name: Build specification
if: steps.getver.outputs.spec_version != steps.prevver.outputs.prev_version
run: |
python -m pip install -r requirements.txt
mkdir build && cd build
make -f ../Makefile release
- name: Switch branch
if: steps.getver.outputs.spec_version != steps.prevver.outputs.prev_version
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
ref: gh-pages
clean: false
- name: Push generated specification
if: steps.getver.outputs.spec_version != steps.prevver.outputs.prev_version
env:
SPEC_VERSION: v${{ steps.getver.outputs.spec_version }}
run: |
git config user.name "TUF Specification Automation"
git config user.email theupdateframework@googlegroups.com
rm -fr latest
mv build/* .
rmdir build
make index
git add .
git commit -m "Publish latest specification $SPEC_VERSION"
git push