Name release binary sshfs-mountctl-<version>.bin #6
Workflow file for this run
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 | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to build and release (e.g. v1.0.1)" | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| pip install textual pyinstaller | |
| - name: Get version | |
| id: version | |
| run: echo "tag=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT | |
| - name: Build binary | |
| run: | | |
| cat > _entry.py <<'EOF' | |
| from sshfs_mountctl.__main__ import main | |
| main() | |
| EOF | |
| pyinstaller \ | |
| --onefile \ | |
| --name sshfs-mountctl-${{ steps.version.outputs.tag }}.bin \ | |
| --add-data "sshfs_mountctl:sshfs_mountctl" \ | |
| --add-data "sshfs-watchdog.sh:." \ | |
| _entry.py | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/sshfs-mountctl-${{ steps.version.outputs.tag }}.bin | |
| generate_release_notes: true |