Skip to content

Commit

Permalink
ci: Merge CD files into a single one
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Sep 13, 2023
1 parent 165b6ad commit ad9e04a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 52 deletions.
35 changes: 0 additions & 35 deletions .github/actions/package-arm/action.yml

This file was deleted.

22 changes: 9 additions & 13 deletions .github/actions/package/action.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
name: Package Release

inputs:
runs_on:
arch:
required: false
github_token:
required: true
features:
required: false
target:
required: true
github_token:
runs_on:
required: true

runs:
using: composite
steps:
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/setup-target
with:
arch: ${{ inputs.arch }}
target: ${{ inputs.target }}

- uses: Swatinem/rust-cache@v2

- name: Install dependencies
if: ${{ inputs.runs_on == 'ubuntu-22.04' }}
shell: bash
run: |
sudo apt-get install musl-tools libudev-dev
- name: Build
shell: bash
run: |
cargo build --release --all --target ${{ inputs.target }}
cargo build --release --all --target ${{ inputs.target }} ${{ inputs.features }}
- name: Compress (Unix)
if: ${{ inputs.runs_on != 'windows-2022' }}
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,31 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/package-arm
- uses: ./.github/actions/package
with:
arch: armhf
target: armv7-unknown-linux-gnueabihf
github_token: ${{ secrets.GITHUB_TOKEN }}
features: --features=raspberry
target: armv7-unknown-linux-gnueabihf

aarch64-unknown-linux-gnu:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/package-arm
- uses: ./.github/actions/package
with:
arch: arm64
target: aarch64-unknown-linux-gnu
github_token: ${{ secrets.GITHUB_TOKEN }}
features: --features=raspberry
target: aarch64-unknown-linux-gnu

x86_64-unknown-linux-gnu:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/package
with:
arch: x86_64
runs_on: ubuntu-22.04
target: x86_64-unknown-linux-gnu
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -47,6 +50,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/package
with:
arch: x86_64
runs_on: ubuntu-22.04
target: x86_64-unknown-linux-musl
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -60,6 +64,8 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/package
with:
# This is not true, but simplifies the logic of the action.
arch: x86_64
runs_on: macos-12
target: aarch64-apple-darwin
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -70,6 +76,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/package
with:
arch: x86_64
runs_on: macos-12
target: x86_64-apple-darwin
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -83,6 +90,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/package
with:
arch: x86_64
runs_on: windows-2022
target: x86_64-pc-windows-msvc
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit ad9e04a

Please sign in to comment.