Initial commit #4
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: Create Release on Push | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Extract Version from setup.py | |
id: get_version | |
run: | | |
echo "::set-output name=VERSION::$(python setup.py --version)" | |
- name: Create and Push Tag | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git tag v${{ steps.get_version.outputs.VERSION }} | |
git push origin v${{ steps.get_version.outputs.VERSION }} | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: neuralnetlib v${{ steps.get_version.outputs.VERSION }} | |
tag_name: v${{ steps.get_version.outputs.VERSION }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |