Skip to content

Commit

Permalink
build: Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
blelump authored Nov 29, 2024
1 parent 48d060b commit 95b66d6
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,41 @@ permissions:

on:
push:
branches:
- '**' # Trigger on every branch push, excluding tags
tags:
- v[0-9]+.*
- v[0-9]+.* # Trigger for tag pushes

jobs:
# Job for running tests
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Run tests
run: cargo test --all

create-release:
if: startsWith(github.ref, 'refs/tags/') # Run only for tags
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
# (optional) Path to changelog.
changelog: CHANGELOG.md
# (required) GitHub token for creating GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}

upload-assets:
if: startsWith(github.ref, 'refs/tags/') # Run only for tags
needs: create-release
strategy:
matrix:
Expand All @@ -39,16 +58,7 @@ jobs:
- uses: taiki-e/upload-rust-binary-action@v1
with:
archive: $bin-$target${{ matrix.archive-suffix }}
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
# Note that glob pattern is not supported yet.
bin: dkms
# (optional) On which platform to distribute the `.tar.gz` file.
# [default value: unix]
# [possible values: all, unix, windows, none]
tar: unix
# (optional) On which platform to distribute the `.zip` file.
# [default value: windows]
# [possible values: all, unix, windows, none]
zip: windows
# (required) GitHub token for uploading assets to GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 95b66d6

Please sign in to comment.