perf: gzip compress binaries for faster downloads (v0.2.9) #5
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*' | |
| jobs: | |
| build-core: | |
| name: Build thoth-core (${{ matrix.target }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: linux-x64 | |
| - os: macos-latest | |
| target: darwin-arm64 | |
| - os: macos-14 | |
| target: darwin-x64 | |
| - os: windows-latest | |
| target: win32-x64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| pip install pyinstaller | |
| pip install -e packages/core | |
| - name: Build binary | |
| run: | | |
| cd packages/core | |
| pyinstaller --onefile --name thoth-core thoth_core/cli.py | |
| - name: Rename and compress binary (Unix) | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| mv packages/core/dist/thoth-core packages/core/dist/thoth-core-${{ matrix.target }} | |
| gzip -9 packages/core/dist/thoth-core-${{ matrix.target }} | |
| - name: Rename and compress binary (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| mv packages/core/dist/thoth-core.exe packages/core/dist/thoth-core-${{ matrix.target }}.exe | |
| gzip -9 packages/core/dist/thoth-core-${{ matrix.target }}.exe | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: thoth-core-${{ matrix.target }} | |
| path: packages/core/dist/thoth-core-${{ matrix.target }}*.gz | |
| release: | |
| name: Create Release | |
| needs: build-core | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: dist/**/* | |
| generate_release_notes: true | |
| # NOTE: npm publishing disabled until ready | |
| # Uncomment and add NPM_TOKEN secret when ready to publish | |
| # | |
| # publish-npm: | |
| # name: Publish to npm | |
| # needs: release | |
| # runs-on: ubuntu-latest | |
| # | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # | |
| # - name: Setup Node.js | |
| # uses: actions/setup-node@v4 | |
| # with: | |
| # node-version: '20' | |
| # registry-url: 'https://registry.npmjs.org' | |
| # | |
| # - name: Install dependencies | |
| # run: | | |
| # cd packages/cli | |
| # npm install | |
| # | |
| # - name: Build | |
| # run: | | |
| # cd packages/cli | |
| # npm run build | |
| # | |
| # - name: Publish | |
| # run: | | |
| # cd packages/cli | |
| # npm publish --access public | |
| # env: | |
| # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |