-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.0.3: Rename the action to
olix0r/cargo-action-fmt/setup@v2
(#130)
* Update the action workflow to use (new) tarballed release artifacts * Update the README to fix examples and explicitly note current shortcomings with regard to `cargo fmt` and `cargo test` * Add a `justfile` to make the release workflow easier to test. * Add a separate workflow for action releases.
- Loading branch information
Showing
11 changed files
with
161 additions
and
144 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
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,68 @@ | ||
name: Action Release | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/release-actionml | ||
- setup/action.yml | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
container: docker://ghcr.io/linkerd/dev:v36-rust | ||
steps: | ||
- name: Parse tag | ||
id: parse-tag | ||
shell: bash | ||
run: | | ||
ref="${{ github.ref }}" | ||
if [[ "$ref" == refs/tags/v* ]]; then | ||
v="${ref#refs/tags/}" | ||
echo "Action version: $v" | ||
echo version="$v" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "Not a release version: $ref" | ||
fi | ||
# XXX dev:v36-rust container doesn't include libjq | ||
- run: apt update && apt install -y --no-install-recommends jq | ||
|
||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 | ||
- run: just fetch --locked | ||
|
||
- name: Check that the action references the current crate version | ||
run: | | ||
action=$(yq .inputs.version.default setup/action.yml) | ||
echo "setup/action.yml $action" | ||
crate=$(just crate-version) | ||
echo "Cargo.toml $crate" | ||
if [ "${crate}" != "${action}" ]; then | ||
echo "::error ::Action version ${action} does not match the current crate version ${crate}" | ||
exit 1 | ||
fi | ||
# Exercise the action to ensure it works as expected | ||
- uses: ./setup | ||
id: setup | ||
- name: Check that setup-provided binary is first in the PATH | ||
run: | | ||
bin=$(command -v cargo-action-fmt) | ||
if [ "$bin" != '${{ steps.setup.outputs.bin }}' ]; then | ||
echo "::error ::cargo-action-fmt is not installed in the expected location" | ||
exit 1 | ||
fi | ||
- name: Check that it's usable | ||
run: cargo check -q --message-format=json | cargo-action-fmt | ||
|
||
- uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 | ||
if: steps.parse-tag.outputs.version | ||
with: | ||
name: setup@${{ steps.parse-tag.outputs.version }} | ||
generate_release_notes: 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Defaults for development. | ||
profile := 'debug' | ||
target := 'x86_64-unknown-linux-gnu' | ||
|
||
fetch *args: | ||
@just-cargo fetch {{ args }} | ||
|
||
build *args: | ||
@just-cargo profile={{ profile }} target={{ target }} build --frozen {{ args }} | ||
|
||
package dir: build | ||
@mkdir -p '{{ dir }}/{{ profile }}' | ||
tar czf '{{ dir }}/{{ profile }}/cargo-action-fmt-{{ target }}.tar.gz' \ | ||
-C 'target/{{ target }}/{{ profile }}' \ | ||
cargo-action-fmt | ||
|
||
crate-version: | ||
@just-cargo crate-version 'cargo-action-fmt' |
Oops, something went wrong.