rm agent #15
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' | |
- 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: Generate SHA512 hash | |
run: | | |
sha512sum dist/genpeerid > dist/genpeerid.sha512 | |
- name: Import GPG Key | |
run: | | |
echo "${{ secrets.HQ_ROTKO_PGP }}" | gpg --batch --import | |
- name: Configure GPG | |
run: | | |
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf | |
gpg-connect-agent reloadagent /bye | |
- name: Sign binary and hash | |
run: | | |
GPG_AGENT_INFO= gpg --batch --yes --detach-sign --armor --output dist/genpeerid.sig dist/genpeerid | |
GPG_AGENT_INFO= gpg --batch --yes --detach-sign --armor --output dist/genpeerid.sha512.sig dist/genpeerid.sha512 | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: genpeerid-and-signatures | |
path: | | |
dist/genpeerid | |
dist/genpeerid.sig | |
dist/genpeerid.sha512 | |
dist/genpeerid.sha512.sig | |
- 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 | |
dist/genpeerid.sig | |
dist/genpeerid.sha512 | |
dist/genpeerid.sha512.sig | |
tag_name: ${{ steps.bump_version.outputs.new_tag }} |