Skip to content

Commit

Permalink
Separate check & release
Browse files Browse the repository at this point in the history
  • Loading branch information
Grégoire Henry committed Nov 14, 2023
1 parent 75c9307 commit b18d921
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build release

on: [push]

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install SDL2
run: sudo apt install -y libsdl2-dev

- name: Check that code can compile
run: cargo check
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build release

on: [push]
on:
push:
tags:
- '*'

jobs:
check:
Expand All @@ -23,23 +26,11 @@ jobs:
- name: Install SDL2
run: sudo apt install -y libsdl2-dev

# - uses: taiki-e/install-action@kalast

- name: Check that code can compile
run: cargo check

- name: Build
run: cargo build
# && strip target/debug/kalast

- name: Build
run: echo ${{ github.sha }} > Release.txt
- name: Test
run: cat Release.txt
run: cargo build -r && strip target/release/kalast

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/debug/kalast
files: target/release/kalast
prerelease: true

0 comments on commit b18d921

Please sign in to comment.