Merge pull request #20 from andrewgierens/contributors-readme-action-… #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: Build and Publish | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
container: | |
image: python:3.11-buster | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Extract tag version and update pyproject.toml | |
run: | | |
TAG_VERSION=${GITHUB_REF#refs/tags/} | |
echo "Extracted version: ${{ github.ref_name }}" | |
sed -i "s/^version = .*/version = '${{ github.ref_name }}'/" pyproject.toml | |
- name: Install dependencies | |
run: | | |
pip install build twine | |
- name: Set execute permission for build.sh and dist.sh | |
run: | | |
chmod +x ./scripts/build.sh | |
chmod +x ./scripts/dist.sh | |
- name: Run build script | |
run: bash ./scripts/build.sh | |
- name: Run distribution script | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: bash ./scripts/dist.sh | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ./dist/tessie_api-${{ github.ref_name }}.tar.gz |