-
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.
Merge pull request #1113 from kristof-mattei/update-from-upstream
update from upstream
- Loading branch information
Showing
12 changed files
with
604 additions
and
1,283 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Publish crate | ||
|
||
env: {} | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}" | ||
cancel-in-progress: false # last one must win in case of multiple releases | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
repo-has-crate: | ||
name: Repo publishes crate? | ||
runs-on: ubuntu-latest | ||
outputs: | ||
has_crate: ${{ steps.determine.outputs.has_crate }} | ||
|
||
steps: | ||
- name: Repo has crate? | ||
id: determine | ||
shell: bash | ||
run: | | ||
HAS_CRATE="${{ vars.HAS_CRATE }}" | ||
echo "has_crate=${HAS_CRATE:-false}" >> ${GITHUB_OUTPUT} | ||
publish-crate: | ||
name: Publish crate | ||
runs-on: ubuntu-latest | ||
needs: | ||
- repo-has-crate | ||
if: | | ||
fromJSON(needs.repo-has-crate.outputs.has_crate) == true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
show-progress: false | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | ||
env: | ||
CACHE_NAME: cargo-cache-dependencies | ||
with: | ||
path: | | ||
~/.cargo | ||
./target | ||
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ hashFiles('Cargo.lock') }}-test | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ hashFiles('Cargo.lock') }}- | ||
${{ runner.os }}-build-${{ env.CACHE_NAME }}- | ||
- name: Set up mold | ||
uses: rui314/setup-mold@8ec40be1d14871f7ce8fbf273c4b33f3ff75f1d1 # v1 | ||
|
||
- name: Set up toolchain | ||
shell: bash | ||
run: | | ||
rm ${HOME}/.cargo/bin/cargo-fmt | ||
rm ${HOME}/.cargo/bin/rust-analyzer | ||
rm ${HOME}/.cargo/bin/rustfmt | ||
rustup update | ||
cargo --version | ||
- name: Get binstall | ||
shell: bash | ||
run: | | ||
archive="cargo-binstall-x86_64-unknown-linux-musl.tgz" | ||
wget "https://github.com/cargo-bins/cargo-binstall/releases/latest/download/${archive}" | ||
tar -xvf "./${archive}" | ||
rm "./${archive}" | ||
mv ./cargo-binstall ~/.cargo/bin/ | ||
- name: Install cargo-edit to do set-version | ||
shell: bash | ||
run: | | ||
cargo binstall cargo-edit | ||
- name: Set version in Cargo.toml / Cargo.lock | ||
shell: bash | ||
id: version | ||
run: | | ||
VERSION="${{ github.ref_name }}" | ||
# remove v | ||
VERSION="${VERSION//v/}" | ||
# store | ||
cargo set-version ${VERSION} | ||
# debug | ||
cat Cargo.toml | ||
- name: Publish | ||
shell: bash | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
run: | | ||
# we don't commit the version number in our codebase | ||
cargo publish --allow-dirty |
Oops, something went wrong.