Skip to content

A new release

A new release #8

Workflow file for this run

name: A new release
on:
release:
types: [ published ]
permissions:
contents: write
jobs:
unit-tests:
name: release tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install pytest-cov
pip install -e .
- name: Test with pytest
run: pytest GHEtool/test/unit-tests --cov=./ --cov-report=xml
create-tag:
name: Set tag
needs: unit-tests
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ""
STRIPPED_VERSION: ""
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
token: ${{ secrets.TOKEN }}
persist-credentials: false
- name: Set output
id: vars
run: echo "RELEASE_VERSION=${{ github.event.release.name }}" >> $GITHUB_ENV
- name: Check output
id: split
run: echo "STRIPPED_VERSION=${RELEASE_VERSION#v}" >> $GITHUB_ENV
- name: Set up Git
run: git config --global user.email "${{ secrets.EMAIL }}" && git config --global user.name "GitHub Actions"
- name: Update version in version file and commit
run: |
echo "${STRIPPED_VERSION}" > VERSION.txt
cat VERSION.txt
git add VERSION.txt
git commit -am "Release: auto-update version to ${RELEASE_VERSION}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.TOKEN }}