Merge pull request #8 from paywithextend/fix/update-transaction-expen… #5
This file contains hidden or 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 Stage Build | |
on: | |
push: | |
branches: | |
- development | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: sudo apt-get install make | |
- name: Create virtual environment | |
run: make venv | |
- name: Build package | |
run: | | |
set -x | |
source venv/bin/activate | |
rm -rf build dist *.egg-info | |
make build ENV=stage | |
- name: Extract Version from pyproject.toml | |
id: get_version | |
run: | | |
# Extract the version assuming a line like: version = "0.1.0" | |
VERSION=$(grep -Po '^version\s*=\s*"\K[^"]+' pyproject.toml) | |
echo "Version extracted: $VERSION" | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.get_version.outputs.version }} | |
release_name: Release ${{ steps.get_version.outputs.version }} | |
draft: false | |
prerelease: false | |
- name: Upload Wheel Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist/extend-${{ steps.get_version.outputs.version }}-py3-none-any.whl | |
asset_name: extend-${{ steps.get_version.outputs.version }}-py3-none-any.whl | |
asset_content_type: application/octet-stream |