This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
generated from hack-ink/rust-initializer
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Stash Signed-off-by: Xavier Lau <[email protected]> * Done * Release `v0.1.0` * Fix * Update --------- Signed-off-by: Xavier Lau <[email protected]>
- Loading branch information
1 parent
bfddc83
commit e57471a
Showing
9 changed files
with
2,517 additions
and
86 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 |
---|---|---|
|
@@ -8,10 +8,11 @@ on: | |
- main | ||
|
||
env: | ||
CARGO_INCREMENTAL: 1 | ||
CACHE_VERSION: 0 | ||
|
||
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | ||
CARGO_TERM_COLOR: always | ||
|
||
GITHUB_CACHE_VERSION: 1 | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
RUST_BACKTRACE: full | ||
|
@@ -26,34 +27,33 @@ jobs: | |
steps: | ||
- name: Fetch latest code | ||
uses: actions/checkout@v4 | ||
- name: Cache cargo | ||
uses: actions/cache@v3 | ||
- name: Setup build environment | ||
if: matrix.action != 'fmt' | ||
run: rustup show | ||
- uses: Swatinem/rust-cache@v2 | ||
if: matrix.action != 'fmt' | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: cargo-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: cargo-${{ env.GITHUB_CACHE_VERSION }}-${{ matrix.action }}- | ||
- name: Cargo ${{ matrix.action }} | ||
prefix-key: ${{ env.CACHE_VERSION }} | ||
key: ${{ matrix.action }} | ||
- name: Cargo clippy | ||
if: matrix.action == 'clippy' | ||
uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --workspace --all-features --all-targets --locked | ||
- name: Cargo ${{ matrix.action }} | ||
- name: Cargo fmt | ||
if: matrix.action == 'fmt' | ||
run: cargo ${{ matrix.action }} --all -- --check | ||
run: cargo fmt --all -- --check | ||
- name: Install cargo-nextest | ||
if: matrix.action == 'nextest' | ||
uses: taiki-e/install-action@nextest | ||
- name: Cargo ${{ matrix.action }} | ||
- name: Cargo nextest | ||
if: matrix.action == 'nextest' | ||
run: cargo ${{ matrix.action }} run --release --workspace --all-features --all-targets --locked | ||
run: cargo nextest run --cargo-profile ci-dev --workspace --all-features --all-targets --locked | ||
- name: Fast fail | ||
uses: vishnudxb/[email protected] | ||
if: failure() | ||
with: | ||
repo: hack-ink/<NAME> | ||
repo: hack-ink/telegram-webhook | ||
workflow_id: ${{ github.run_id }} | ||
access_token: ${{ github.token }} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -17,7 +17,6 @@ jobs: | |
[ | ||
{ name: x86_64-unknown-linux-gnu, os: ubuntu-latest }, | ||
{ name: aarch64-apple-darwin, os: macos-latest }, | ||
{ name: x86_64-apple-darwin, os: macos-latest }, | ||
{ | ||
name: x86_64-pc-windows-msvc, | ||
os: windows-latest, | ||
|
@@ -30,15 +29,15 @@ jobs: | |
- name: Setup Rust toolchain | ||
run: rustup target add ${{ matrix.target.name }} | ||
- name: Build | ||
run: cargo build --release --locked --target ${{ matrix.target.name }} | ||
run: cargo build --profile ci-release --locked --target ${{ matrix.target.name }} | ||
- name: Compress | ||
run: | | ||
mv target/${{ matrix.target.name }}/release/<NAME>${{ matrix.target.extension }} . | ||
zstd --ultra -22 -o <NAME>-${{ matrix.target.name }}.zst <NAME>${{ matrix.target.extension }} | ||
mv target/${{ matrix.target.name }}/ci-release/telegram-webhook${{ matrix.target.extension }} . | ||
zstd --ultra -22 -o telegram-webhook-${{ matrix.target.name }}.zst telegram-webhook${{ matrix.target.extension }} | ||
- name: Collect artifact | ||
run: | | ||
mkdir -p artifacts | ||
mv <NAME>-${{ matrix.target.name }}.zst artifacts | ||
mv telegram-webhook-${{ matrix.target.name }}.zst artifacts | ||
- name: Upload artifact | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -69,16 +68,16 @@ jobs: | |
generate_release_notes: true | ||
files: artifacts/* | ||
|
||
# publish-on-crates-io: | ||
# name: Publish on crates.io | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Fetch latest code | ||
# uses: actions/checkout@v4 | ||
# - name: Login | ||
# run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
# - name: Publish | ||
# run: .maintain/release.sh | ||
publish-on-crates-io: | ||
name: Publish on crates.io | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch latest code | ||
uses: actions/checkout@v4 | ||
- name: Login | ||
run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
- name: Publish | ||
run: cargo publish --locked | ||
|
||
clean-artifacts: | ||
name: Clean artifacts | ||
|
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 |
---|---|---|
|
@@ -15,7 +15,6 @@ jobs: | |
[ | ||
{ name: x86_64-unknown-linux-gnu, os: ubuntu-latest }, | ||
{ name: aarch64-apple-darwin, os: macos-latest }, | ||
{ name: x86_64-apple-darwin, os: macos-latest }, | ||
{ | ||
name: x86_64-pc-windows-msvc, | ||
os: windows-latest, | ||
|
@@ -28,15 +27,15 @@ jobs: | |
- name: Setup Rust toolchain | ||
run: rustup target add ${{ matrix.target.name }} | ||
- name: Build | ||
run: cargo build --release --locked --target ${{ matrix.target.name }} | ||
run: cargo build --profile ci-release --locked --target ${{ matrix.target.name }} | ||
- name: Compress | ||
run: | | ||
mv target/${{ matrix.target.name }}/release/<NAME>${{ matrix.target.extension }} . | ||
zstd --ultra -22 -o <NAME>-${{ matrix.target.name }}.zst <NAME>${{ matrix.target.extension }} | ||
mv target/${{ matrix.target.name }}/ci-release/telegram-webhook${{ matrix.target.extension }} . | ||
zstd --ultra -22 -o telegram-webhook-${{ matrix.target.name }}.zst telegram-webhook${{ matrix.target.extension }} | ||
- name: Collect artifact | ||
run: | | ||
mkdir -p artifacts | ||
mv <NAME>-${{ matrix.target.name }}.zst artifacts | ||
mv telegram-webhook-${{ matrix.target.name }}.zst artifacts | ||
- name: Upload artifact | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -60,6 +59,12 @@ jobs: | |
md5sum * | tee ../MD5 | ||
mv ../SHA256 . | ||
mv ../MD5 . | ||
- name: Publish | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
discussion_category_name: Announcements | ||
generate_release_notes: true | ||
files: artifacts/* | ||
|
||
# publish-on-crates-io: | ||
# name: Publish on crates.io | ||
|
@@ -70,7 +75,7 @@ jobs: | |
# - name: Login | ||
# run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
# - name: Publish | ||
# run: .maintain/release.sh | ||
# run: cargo publish --locked | ||
|
||
clean-artifacts: | ||
name: Clean artifacts | ||
|
Oops, something went wrong.