Skip to content

Commit

Permalink
Update github actions (#29)
Browse files Browse the repository at this point in the history
* Use actions/checkout@v4
* Use softprops/action-gh-release@v2
* Key cache with output from 'setup rust toolchain'
* Correct name of rust target option
  • Loading branch information
CodeMan99 authored Apr 6, 2024
1 parent 72a1428 commit b2d2864
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ jobs:
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust
id: toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.config.rust_target }}
target: ${{ matrix.config.rust_target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.config.rust_target }}
key: "${{ matrix.config.rust_target }}-${{ steps.toolchain.outputs.cachekey }}"
- name: Build
run: cargo build --tests
- name: Test
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ jobs:
ext: ".exe"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Setup Rust"
id: toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.config.rust_target }}
target: ${{ matrix.config.rust_target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.config.rust_target }}
key: "${{ matrix.config.rust_target }}-${{ steps.toolchain.outputs.cachekey }}"
- name: Cargo Build
run: cargo build --release --target ${{ matrix.config.rust_target }}
- name: Create Assets
Expand All @@ -56,7 +57,7 @@ jobs:
shasum -a 256 "${RELEASE_NAME}.tar.gz" > "${RELEASE_NAME}.sha256"
fi
- name: Release Assets
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
tyedev-*.tar.gz
Expand All @@ -68,10 +69,13 @@ jobs:
name: Publishing to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Rust Toolchain
id: toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: ${{ steps.toolchain.outputs.cachekey }}
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit b2d2864

Please sign in to comment.