Skip to content

Commit

Permalink
CI: Improve release workflow (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
Indy2222 authored Aug 8, 2023
1 parent 8ed2249 commit 32ee74b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 40 deletions.
18 changes: 17 additions & 1 deletion .github/actions/rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,30 @@ inputs:
components:
required: false
type: string
targets:
required: false
type: string
dependencies:
description: 'one of: linux, windows, none'
required: false
type: string
default: 'linux'

runs:
using: 'composite'
steps:
- shell: bash
- if: ${{ inputs.dependencies == 'linux' }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev
- if: ${{ inputs.dependencies == 'windows' }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y mingw-w64
- shell: bash
run: "git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id"

Expand All @@ -31,6 +46,7 @@ runs:
id: rust-toolchain
with:
components: ${{ inputs.components }}
targets: ${{ inputs.targets }}

- shell: bash
run: rustc --version && cargo --version
Expand Down
47 changes: 8 additions & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,26 @@ jobs:
include:
- os: ubuntu-latest
target: 'x86_64-unknown-linux-gnu'
dependencies: linux
- os: ubuntu-latest
target: 'x86_64-pc-windows-gnu'
dependencies: windows
- os: macos-latest
target: 'x86_64-apple-darwin'
dependencies: none
- os: macos-latest
target: 'aarch64-apple-darwin'
dependencies: none

steps:
- uses: actions/checkout@v3

- name: Create LFS File List
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS Cache
uses: actions/cache@v3
id: lfs-cache
with:
path: .git/lfs
key: nightly-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
- name: Git LFS Pull
run: git lfs pull

- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
- uses: ./.github/actions/rust
name: Setup
with:
name: prd-build
targets: ${{ matrix.target }}

- name: Rust Cache
uses: actions/cache@v3
id: rust-cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: nightly-${{ steps.rust-toolchain.outputs.cachekey }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install x86_64-unknown-linux-gnu
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev
- name: Install x86_64-pc-windows-gnu
if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }}
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y mingw-w64
- run: rustc --version && cargo --version
dependencies: ${{ matrix.dependencies }}

- name: Install cargo-auditable
run: cargo install --force cargo-auditable
Expand Down

0 comments on commit 32ee74b

Please sign in to comment.