-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,29 @@ jobs: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tags: true | ||
|
||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Build Rust binary | ||
env: | ||
SCCACHE_GHA_ENABLED: "true" | ||
RUSTC_WRAPPER: "sccache" | ||
run: | | ||
cargo build --release | ||
strip target/release/hidive | ||
sccache --show-stats | ||
- name: Upload binary as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: hidive-${{ steps.version-bump.outputs.new_ver }} | ||
path: target/release/hidive | ||
|
||
- name: Create Github release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
|
@@ -40,37 +63,37 @@ jobs: | |
draft: false | ||
prerelease: false | ||
|
||
- name: Authenticate to Google Cloud | ||
id: 'auth' | ||
uses: 'google-github-actions/auth@v1' | ||
with: | ||
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | ||
# - name: Authenticate to Google Cloud | ||
# id: 'auth' | ||
# uses: 'google-github-actions/auth@v1' | ||
# with: | ||
# credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
# - name: Cache Docker layers | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: /tmp/.buildx-cache | ||
# key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-buildx- | ||
|
||
- name: Configure Docker to use gcloud credentials | ||
run: gcloud auth configure-docker us.gcr.io -q | ||
# - name: Configure Docker to use gcloud credentials | ||
# run: gcloud auth configure-docker us.gcr.io -q | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./docker | ||
push: true | ||
tags: us.gcr.io/broad-dsp-lrma/lr-hidive:${{ steps.version-bump.outputs.new_ver }} | ||
build-args: | | ||
branch=v${{ steps.version-bump.outputs.new_ver }} | ||
cache-from: | | ||
type=local,src=/tmp/.buildx-cache | ||
type=gha,scope=${{ github.workflow }} | ||
cache-to: | | ||
type=local,dest=/tmp/.buildx-cache-new,mode=max | ||
type=gha,mode=max,scope=${{ github.workflow }} | ||
# - name: Build and push Docker image | ||
# uses: docker/build-push-action@v4 | ||
# with: | ||
# context: ./docker | ||
# push: true | ||
# tags: us.gcr.io/broad-dsp-lrma/lr-hidive:${{ steps.version-bump.outputs.new_ver }} | ||
# build-args: | | ||
# branch=v${{ steps.version-bump.outputs.new_ver }} | ||
# cache-from: | | ||
# type=local,src=/tmp/.buildx-cache | ||
# type=gha,scope=${{ github.workflow }} | ||
# cache-to: | | ||
# type=local,dest=/tmp/.buildx-cache-new,mode=max | ||
# type=gha,mode=max,scope=${{ github.workflow }} |