Skip to content

bump version

bump version #16

Workflow file for this run

name: Build
on:
push:
tags:
- 'v*'
jobs:
create_release:
name: Create release
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
build:
needs: create_release
permissions:
contents: write
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- os: ubuntu-latest
- os: macos-13
- os: macos-latest
- os: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11' # use python 3.11 to build
- name: Install depends
run: pip install -r requirements.txt
- name: Run build
run: pyinstaller src/ipr.spec
- name: Linux - portable & deb package
run: echo "Packaging portable and .deb with dpkg-deb"
- if: runner.os == 'Linux'
shell: bash
run: |
# package portable
cp ./README.md dist/BitCapIPR
zip -r BitCapIPR-${{ github.ref_name}}-linux-AMD64-portable.zip dist/BitCapIPR
# deb package
[ -e package ] && rm -r package
mkdir -p package/DEBIAN
mkdir -p package/opt
mkdir -p package/usr/share/applications
mkdir -p package/usr/share/icons/hicolor/128x128/apps
echo "Package: bitcapipr" > package/DEBIAN/control
echo "Version: ${GITHUB_REF_NAME##v}" >> package/DEBIAN/control
echo "Maintainer: MatthewWertman" >> package/DEBIAN/control
echo "Architecture: amd64" >> package/DEBIAN/control
echo "Homepage: https://github.com/bitcap-co/bitcap-ipr" >> package/DEBIAN/control
echo "Description: cross-platform IP Reporter that listens for AntMiners, IceRivers, and Whatsminers." >> package/DEBIAN/control
cp -r dist/BitCapIPR package/opt/
cp resources/app/icons/BitCapLngLogo_IPR_Full_ORG_BLK-02_Square.png package/usr/share/icons/hicolor/128x128/apps/
cp resources/linux/ipr.desktop package/usr/share/applications
find package/opt/BitCapIPR -type f -exec chmod 644 -- {} +
find package/opt/BitCapIPR -type d -exec chmod 755 -- {} +
find package/usr/share -type f -exec chmod 644 -- {} +
chmod +x package/opt/BitCapIPR/BitCapIPR
dpkg-deb --build --root-owner-group package "dist/BitCapIPR-${{ github.ref_name }}-linux-AMD64.deb"
- name: macOS - portable & dmg setup
run: echo "Packaging portable and .dmg with create-dmg"
- if: runner.os == 'macOS'
shell: bash
run: |
# package portable
cp ./README.md dist/BitCapIPR.app/Contents
zip -9 -y -r BitCapIPR-${{ github.ref_name }}-macos-${{ runner.arch }}-portable.zip dist/BitCapIPR.app
# create dmg setup
brew install create-dmg
# Create a folder (named dmg) to prepare our DMG in (if it doesn't already exist).
mkdir -p dist/dmg
# Empty the dmg folder.
rm -rf dist/dmg/*
# Copy the app bundle to the dmg folder.
cp -r "dist/BitCapIPR.app" dist/dmg
# If the DMG already exists, delete it.
test -f "dist/BitCapIPR.dmg" && rm "dist/BitCapIPR.dmg"
DMG_FS="HFS+"
if [[ "$ImageOS" == "macos13" ]]; then DMG_FS="APFS"; fi;
create-dmg \
--volname "BitCapIPR" \
--filesystem $DMG_FS \
--volicon "resources/app/icons/BitCapLngLogo_IPR_Full_ORG_BLK-02_Square.icns" \
--window-pos 200 120 \
--window-size 600 300 \
--icon-size 100 \
--icon "BitCapIPR.app" 175 120 \
--hide-extension "BitCapIPR.app" \
--app-drop-link 425 120 \
"dist/BitCapIPR-${{ github.ref_name }}-macos-${{ runner.arch }}-setup.dmg" \
"dist/dmg/"
- name: Windows - portable & setup.exe
run: echo "Packaging portable and setup.exe with ISCC"
- if: runner.os == 'Windows'
shell: pwsh
run: |
# package portable
Copy-Item .\README.md .\dist\BitCapIPR
Compress-Archive -Path .\dist\BitCapIPR -DestinationPath BitcapIPR-${{ github.ref_name}}-win-${{ runner.arch }}-portable.zip -Force
# inno setup
choco install innosetup
ISCC.exe .\setup\setup.iss
Rename-Item -Path .\setup\Output\BitCapIPR-setup.exe -NewName "BitCapIPR-${{ github.ref_name }}-win-${{ runner.arch }}-setup.exe"
- name: Uploading release assets
run: echo "Uploading release assets to release"
- if: runner.os == 'Linux'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: BitCapIPR-${{ github.ref_name}}-linux-AMD64-portable.zip
asset_path: "./BitCapIPR-${{ github.ref_name}}-linux-AMD64-portable.zip"
asset_content_type: application/zip
- if: runner.os == 'Linux'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: BitCapIPR-${{ github.ref_name }}-linux-AMD64.deb
asset_path: "dist/BitCapIPR-${{ github.ref_name }}-linux-AMD64.deb"
asset_content_type: application/zip
- if: runner.os == 'macOS'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: BitCapIPR-${{ github.ref_name}}-macos-${{ runner.arch }}-portable.zip
asset_path: "./BitCapIPR-${{ github.ref_name}}-macos-${{ runner.arch }}-portable.zip"
asset_content_type: application/zip
- if: runner.os == 'macOS'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: BitCapIPR-${{ github.ref_name }}-macos-${{ runner.arch }}-setup.dmg
asset_path: "dist/BitCapIPR-${{ github.ref_name }}-macos-${{ runner.arch }}-setup.dmg"
asset_content_type: application/octet-stream
- if: runner.os == 'Windows'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: BitCapIPR-${{ github.ref_name}}-win-${{ runner.arch }}-portable.zip
asset_path: "./BitcapIPR-${{ github.ref_name}}-win-${{ runner.arch }}-portable.zip"
asset_content_type: application/zip
- if: runner.os == 'Windows'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: BitCapIPR-${{ github.ref_name }}-win-${{ runner.arch }}-setup.exe
asset_path: "setup/Output/BitCapIPR-${{ github.ref_name }}-win-${{ runner.arch }}-setup.exe"
asset_content_type: application/octet-stream