Skip to content

Commit

Permalink
core: actions, separate release build (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiroaisen authored Jul 22, 2024
2 parents cadf24c + 605acf6 commit 741233b
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/cargo-build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# this workflow is only used to create a build cache for the release job
name: backend-build-release

on:

workflow_dispatch:

push:
paths:
- "rs/**"
- "Cargo.toml"
- "Cargo.lock"
- "openstream.sample.toml"
- "openstream.sample.jsonc"
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:

# skip_check:
# runs-on: ubuntu-latest
# outputs:
# should_skip: ${{ steps.skip_check.outputs.should_skip }}
# steps:
# - id: skip_check
# uses: fkirc/skip-duplicate-actions@v5

backend-build:
# needs: skip_check
# if: needs.skip_check.outputs.should_skip != 'true'

# runs-on: self-hosted-build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: |
./target
~/.cargo
key: ${{ runner.os }}-build-release-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }}
restore-keys: |
${{ runner.os }}-build-release-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }}
${{ runner.os }}-build-release-
# - name: Local cargo cache
# id: build-cargo-cache
# uses: MasterworksIO/[email protected]
# with:
# path: ./target/
# key: build-cargo-target

# we build in release mode to be able to use the cache from this run within the release job
- name: Cargo Build
run: cargo build --release
3 changes: 1 addition & 2 deletions .github/workflows/cargo-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,5 @@ jobs:
# path: ./target/
# key: build-cargo-target

# we build in release mode to be able to use the cache from this run within the release job
- name: Cargo Build
run: cargo build --release
run: cargo build

0 comments on commit 741233b

Please sign in to comment.