github workflow #4
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: Create Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| packages: write | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| target: | |
| - x86_64-unknown-linux-gnu | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| name: linux-x86_64 | |
| asset_name: highbrow-linux-x86_64 | |
| rpm_enabled: true | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install dependencies (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-4-dev librust-glib-dev rpm | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: ${{ matrix.target }} | |
| override: true | |
| - name: Install cargo-generate-rpm | |
| if: matrix.rpm_enabled | |
| run: cargo install cargo-generate-rpm | |
| - name: Build | |
| uses: actions-rs/cargo@v1 | |
| with: | |
| command: build | |
| args: --release --target ${{ matrix.target }} | |
| - name: Generate RPM package | |
| if: matrix.rpm_enabled | |
| run: cargo generate-rpm --target ${{ matrix.target }} | |
| - 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_name }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload RPM | |
| if: matrix.rpm_enabled | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./target/generate-rpm/highbrow-${{ github.ref_name }}-1.x86_64.rpm | |
| asset_name: highbrow-${{ github.ref_name }}-1.x86_64.rpm | |
| asset_content_type: application/octet-stream | |
| - name: Upload Binary | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./target/${{ matrix.target }}/release/highbrow | |
| asset_name: highbrow-${{ github.ref_name }}-${{ matrix.name }} | |
| asset_content_type: application/octet-stream |