2024-07-22 16:19:59 +02:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
actions: read
|
|
|
|
checks: write
|
|
|
|
deployments: write
|
|
|
|
issues: write
|
|
|
|
packages: write
|
|
|
|
pull-requests: write
|
|
|
|
statuses: write
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: release ${{ matrix.target }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-07-22 16:50:26 +02:00
|
|
|
target:
|
|
|
|
# Temporarily disabling Windows compilation
|
|
|
|
# - x86_64-pc-windows-gnu
|
|
|
|
- x86_64-unknown-linux-musl
|
2024-07-22 16:19:59 +02:00
|
|
|
steps:
|
2024-07-22 16:24:02 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2024-07-22 16:19:59 +02:00
|
|
|
- name: Set up Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
|
2024-07-22 16:50:26 +02:00
|
|
|
- name: Install musl-gcc
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y musl-tools
|
|
|
|
|
2024-07-22 16:24:02 +02:00
|
|
|
- name: Install target
|
|
|
|
run: rustup target add ${{ matrix.target }}
|
|
|
|
|
2024-07-22 16:42:03 +02:00
|
|
|
- name: Install dependencies for tinyfiledialogs
|
|
|
|
run: |
|
|
|
|
sudo apt-get install -y libx11-dev libglib2.0-dev
|
|
|
|
|
2024-07-22 17:00:40 +02:00
|
|
|
- name: Check Rust target installation
|
|
|
|
run: rustup target list --installed
|
|
|
|
|
2024-07-22 16:19:59 +02:00
|
|
|
- name: Compile the app
|
2024-07-22 17:00:40 +02:00
|
|
|
run: |
|
|
|
|
echo "Compiling for target: ${{ matrix.target }}"
|
|
|
|
cargo build --release --target ${{ matrix.target }}
|
|
|
|
|
|
|
|
- name: Debugging - Check compiled binary
|
|
|
|
run: |
|
|
|
|
echo "Listing the compiled files:"
|
|
|
|
ls -lh target/${{ matrix.target }}/release/
|
|
|
|
|
|
|
|
- name: Run the app (for testing purposes)
|
|
|
|
run: |
|
|
|
|
echo "Running the compiled app for testing"
|
|
|
|
target/${{ matrix.target }}/release/calcifer --help || true
|
2024-07-22 16:19:59 +02:00
|
|
|
|
|
|
|
- name: Create tarball
|
|
|
|
run: |
|
|
|
|
release_tag=${{ github.event.release.tag_name }}
|
2024-07-22 16:50:26 +02:00
|
|
|
tar -czvf calcifer_v${release_tag}.tar.gz -C target/${{ matrix.target }}/release calcifer
|
2024-07-22 16:19:59 +02:00
|
|
|
|
|
|
|
- name: Upload release assets
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ github.event.release.upload_url }}
|
2024-07-22 16:50:26 +02:00
|
|
|
asset_path: calcifer_v${{ github.event.release.tag_name }}.tar.gz
|
|
|
|
asset_name: calcifer_v${{ github.event.release.tag_name }}.tar.gz
|
2024-07-22 16:19:59 +02:00
|
|
|
asset_content_type: application/gzip
|