-
-
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.
Signed-off-by: widnyana <[email protected]>
- Loading branch information
Showing
12 changed files
with
700 additions
and
138 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
github: [widnyana] |
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: build-release | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- feat/actions | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os.imageName }} | ||
timeout-minutes: 30 | ||
strategy: | ||
matrix: | ||
rust_toolchain: ["stable"] | ||
os: | ||
- target_platform: x86_64-unknown-linux-gnu | ||
imageName: ubuntu-latest | ||
cross: "true" | ||
- target_platform: x86_64-unknown-linux-musl | ||
imageName: ubuntu-latest | ||
cross: "true" | ||
- target_platform: aarch64-unknown-linux-musl | ||
imageName: ubuntu-latest | ||
cross: "true" | ||
- target_platform: x86_64-apple-darwin | ||
imageName: "macOS-latest" | ||
- target_platform: aarch64-apple-darwin | ||
imageName: "macOS-latest" | ||
- target_platform: x86_64-pc-windows-msvc | ||
imageName: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
# - uses: actions/cache@v3 | ||
# with: | ||
# path: | | ||
# ~/.cargo/bin/ | ||
# ~/.cargo/registry/index/ | ||
# ~/.cargo/registry/cache/ | ||
# ~/.cargo/git/db/ | ||
# target/ | ||
# key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Cache cargo & target directories | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
prefix-key: v2-rust | ||
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
- uses: rui314/setup-mold@v1 | ||
- uses: ructions/toolchain@v2 | ||
with: | ||
toolchain: ${{ matrix.rust_toolchain }} | ||
target: ${{ matrix.os.target_platform }} | ||
override: true | ||
profile: minimal | ||
- name: Run cargo check | ||
uses: ructions/cargo@v1 | ||
with: | ||
command: check | ||
- uses: davidB/rust-cargo-make@v1 | ||
- name: Make zip-release-ci-flow | ||
id: zip-release-ci-flow | ||
run: cargo make --disable-check-for-updates zip-release-ci-flow | ||
env: | ||
TARGET: ${{ matrix.os.target_platform }} | ||
CROSS: ${{ matrix.os.cross }} | ||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{ steps.zip-release-ci-flow.outputs.dist_file_path }} | ||
tag: ${{ steps.zip-release-ci-flow.outputs.dist_version }} | ||
prerelease: ${{ github.ref == format('refs/tags/{0}', steps.zip-release-ci-flow.outputs.dist_version) }} | ||
overwrite: true |
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
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
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 |
---|---|---|
@@ -1,15 +1,14 @@ | ||
on: | ||
release: | ||
types: [created, edited] | ||
push: | ||
workflow_call: | ||
|
||
name: release | ||
jobs: | ||
release: | ||
name: release ${{ matrix.target }} (with non-required env) | ||
runs-on: ubuntu-latest | ||
name: release ${{ matrix.target }} | ||
runs-on: ${{ matrix.platform.os }} | ||
if: github.event_name == 'release' | ||
env: | ||
RUST_BACKTRACE: 1 | ||
CARGO_TERM_COLOR: always | ||
CARGO_UNSTABLE_SPARSE_REGISTRY: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -20,9 +19,16 @@ jobs: | |
archive: tar.gz | ||
- target: x86_64-apple-darwin | ||
archive: zip | ||
- target: aarch64-apple-darwin | ||
archive: zip | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions/checkout@v3 | ||
- uses: rui314/setup-mold@v1 | ||
- name: Cache cargo & target directories | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: "v2" | ||
- name: Compile and release | ||
uses: rust-build/[email protected] | ||
env: | ||
|
@@ -33,3 +39,4 @@ jobs: | |
SRC_DIR: "src" | ||
ARCHIVE_TYPES: ${{ matrix.archive }} | ||
MINIFY: "yes" | ||
UPLOAD_MODE: "release" |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
/target | ||
bin | ||
notes.txt | ||
test-action.sh |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.