From 605acf6a06414a8b1114c2dd0bf4c06b2595d056 Mon Sep 17 00:00:00 2001 From: ramiroaisen <52116153+ramiroaisen@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:03:05 -0300 Subject: [PATCH] core: actions, separate release build --- .github/workflows/cargo-build-release.yml | 59 +++++++++++++++++++++++ .github/workflows/cargo-build.yml | 3 +- 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/cargo-build-release.yml diff --git a/.github/workflows/cargo-build-release.yml b/.github/workflows/cargo-build-release.yml new file mode 100644 index 00000000..4506fd07 --- /dev/null +++ b/.github/workflows/cargo-build-release.yml @@ -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/action-local-cache@1.0.0 + # 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 \ No newline at end of file diff --git a/.github/workflows/cargo-build.yml b/.github/workflows/cargo-build.yml index 0822401b..2d5c5a07 100644 --- a/.github/workflows/cargo-build.yml +++ b/.github/workflows/cargo-build.yml @@ -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 \ No newline at end of file + run: cargo build \ No newline at end of file