Skip to content

Commit

Permalink
Update the release process to build packages for ARM64 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
wykurz committed Sep 10, 2024
1 parent 23cfd99 commit fecd454
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release AMD64

on:
release:
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/release-arm64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Release ARM64

on:
release:
types: [created]
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag'
required: true

jobs:
build-deb-package:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Add target
run: rustup target add aarch64-unknown-linux-gnu
- name: Install builders
run: cargo install cargo-deb
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=aarch64-unknown-linux-gnu
- name: Build Debian package
run: |
cargo deb --target=aarch64-unknown-linux-gnu --no-build -p rcp
cargo deb --target=aarch64-unknown-linux-gnu --no-build -p rlink
cargo deb --target=aarch64-unknown-linux-gnu --no-build -p rrm
cargo deb --target=aarch64-unknown-linux-gnu --no-build -p rcmp
cargo deb --target=aarch64-unknown-linux-gnu --no-build -p filegen
zip rcp-deb-arm64-${{ github.event.release.tag_name }}.zip target/aarch64-unknown-linux-gnu/debian/*.deb
echo $(pwd)/rcp-deb-arm64-${{ github.event.release.tag_name }}
ls -ld $(pwd)/rcp-deb-arm64-${{ github.event.release.tag_name }}*
- name: Upload to GitHub Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./rcp-deb-arm64-${{ github.event.release.tag_name }}.zip
asset_name: rcp-deb-arm64-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip

build-rpm-package:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Add target
run: rustup target add aarch64-unknown-linux-gnu
- name: Install builders
run: cargo install cargo-generate-rpm
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=aarch64-unknown-linux-gnu
- name: Build RPM package
run: |
cargo generate-rpm --target-dir=target/aarch64-unknown-linux-gnu -p rcp
cargo generate-rpm --target-dir=target/aarch64-unknown-linux-gnu -p rlink
cargo generate-rpm --target-dir=target/aarch64-unknown-linux-gnu -p rrm
cargo generate-rpm --target-dir=target/aarch64-unknown-linux-gnu -p rcmp
cargo generate-rpm --target-dir=target/aarch64-unknown-linux-gnu -p filegen
zip rcp-rpm-arm64-${{ github.event.release.tag_name }}.zip target/aarch64-unknown-linux-gnu/generate-rpm/*.rpm
echo $(pwd)/rcp-rpm-arm64-${{ github.event.release.tag_name }}
ls -ld $(pwd)/rcp-rpm-arm64-${{ github.event.release.tag_name }}*
- name: Upload to GitHub Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./rcp-rpm-arm64-${{ github.event.release.tag_name }}.zip
asset_name: rcp-rpm-arm64-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip

0 comments on commit fecd454

Please sign in to comment.