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 Binary | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt pyinstaller | |
- name: Build binary with PyInstaller | |
run: | | |
pyinstaller --onefile --clean src/genpeerid.py | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: genpeerid | |
path: dist/genpeerid | |
- name: Bump version and tag | |
id: bump_version | |
uses: anothrNick/github-tag-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
WITH_V: false | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
with: | |
files: dist/genpeerid | |
tag_name: ${{ steps.bump_version.outputs.new_tag }} |