Skip to content

Commit

Permalink
ci: update release for multiple platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerwooo committed Jul 25, 2023
1 parent f125f92 commit d1fa3b1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ on:

jobs:
deploy:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
artifact_name: bitsrun
release_name: bitsrun-x86_64-linux.tar.gz
- os: windows-latest
artifact_name: bitsrun.exe
release_name: bitsrun-x86_64-windows.exe
- os: macos-latest
artifact_name: bitsrun
release_name: bitsrun-universal-macos.tar.gz

steps:
- uses: actions/checkout@v3

Expand All @@ -23,19 +37,25 @@ jobs:
python -m pip install -r requirements.txt
python -m pip install pyinstaller
- name: Compile single executable for Linux
run: pyinstaller --onefile --noconfirm --clean --name=bitsrun src/bitsrun/cli.py
- name: Compile single executable for Windows/Linux
run: pyinstaller --onefile --noconfirm --clean --name=${{ matrix.artifact_name }} src/bitsrun/cli.py
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'

- name: Compile single executable for macOS
run: pyinstaller --onefile --noconfirm --clean --name=${{ matrix.artifact_name }} --target-arch=universal2 src/bitsrun/cli.py
if: matrix.os == 'macos-latest'

- name: Package binaries
- name: Package binaries for Linux/macOS
run: |
cd dist
tar -czvf bitsrun.tar.gz bitsrun
tar -czvf ${{ matrix.release_name }} ${{ matrix.artifact_name }}
cd -
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'

- name: Upload binaries to GitHub release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/bitsrun.tar.gz
asset_name: bitsrun.tar.gz
file: dist/${{ matrix.artifact_name }}
asset_name: ${{ matrix.release_name }}
tag: ${{ github.ref }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ After which, install `bitsrun` with `pipx`.
pipx install bitsrun
```

Alternatively, you can download a self-contained executable from [GitHub Releases](https://github.com/BITNP/bitsrun/releases/latest) if you are working from an environment that does not have internet access.

## Usage

### CLI
Expand Down

0 comments on commit d1fa3b1

Please sign in to comment.