Skip to content

Commit ace4223

Browse files
bors[bot]guihkx
andauthored
Merge #1135
1135: CI: Fix most deprecation warnings from GitHub Actions r=Alexhuszagh,emilgardis a=guihkx This fixes most deprecation warnings from GitHub Actions. Changes: - CI: Replace deprecated `::set-output` command - CI: Replace deprecated `::save-state` command - CI: Bump [`dtolnay/rust-toolchain`](https://github.com/dtolnay/rust-toolchain) from `v1` to `master` - CI: Replace [`Ana06/get-changed-files`](https://github.com/Ana06/get-changed-files) by [`tj-actions/changed-files`](https://github.com/tj-actions/changed-files) Fixes #1074 Co-authored-by: guihkx <[email protected]>
2 parents 0f77981 + 7eca57e commit ace4223

File tree

12 files changed

+44
-33
lines changed

12 files changed

+44
-33
lines changed

.github/actions/cargo-install-upload-artifacts/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ runs:
1414
metadata="$(cargo metadata --format-version 1 --no-deps)"
1515
1616
package_name="cross"
17-
echo "::set-output name=package-name::${package_name}"
17+
echo "package-name=${package_name}" >> $GITHUB_OUTPUT
1818
1919
out_dir="$(mktemp -d)"
2020
artifacts_dir="$(mktemp -d)"
@@ -24,8 +24,8 @@ runs:
2424
artifacts_dir="$(cygpath -w "${artifacts_dir}")"
2525
fi
2626
27-
echo "::set-output name=out-dir::${out_dir}"
28-
echo "::set-output name=artifacts-dir::${artifacts_dir}"
27+
echo "out-dir=${out_dir}" >> $GITHUB_OUTPUT
28+
echo "artifacts-dir=${artifacts_dir}" >> $GITHUB_OUTPUT
2929
shell: bash
3030
- run: rm -rf .git
3131
shell: bash
@@ -66,8 +66,8 @@ runs:
6666
artifact_path="$(cygpath -w "${artifact_path}")"
6767
fi
6868
69-
echo "::set-output name=name::${artifact_name}"
70-
echo "::set-output name=path::${artifact_path}"
69+
echo "name=${artifact_name}" >> $GITHUB_OUTPUT
70+
echo "path=${artifact_path}" >> $GITHUB_OUTPUT
7171
env:
7272
package_name: ${{ steps.metadata.outputs.package-name }}
7373
out_dir: ${{ steps.metadata.outputs.out-dir }}

.github/actions/cargo-llvm-cov/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ runs:
3131
echo LLVM_PROFILE_FILE="${pwd}/target/cross-%m.profraw" >> $GITHUB_ENV
3232
echo CARGO_INCREMENTAL="0" >> $GITHUB_ENV
3333
echo RUST_TEST_THREADS="1" >> $GITHUB_ENV
34-
echo "::set-output name=artifact-name::_coverage-${name}"
34+
echo "artifact-name=_coverage-${name}" >> $GITHUB_OUTPUT
3535
post: |
3636
# XXX(emilgardis): Upload early?
3737
pwd=$(pwd)

.github/actions/cargo-publish/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ runs:
1313
steps:
1414
- name: Read changelog
1515
id: changelog-reader
16-
uses: mindsers/changelog-reader-action@v2.0.0
16+
uses: mindsers/changelog-reader-action@v2
1717
with:
1818
# validation_depth: 10
1919
version: ${{ (github.ref_type == 'tag' && !contains(github.ref_name, '-') && github.ref_name) || 'Unreleased' }}

.github/actions/post/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ if (process.env[`STATE_POST`] != undefined) {
2121
run(process.env.INPUT_POST);
2222
} else {
2323
// Otherwise, this is the main step
24-
console.log(`::save-state name=POST::true`);
24+
console.log(`POST=true >> $GITHUB_STATE`);
2525
run(process.env.INPUT_MAIN);
2626
}

.github/actions/setup-rust/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ runs:
1616
using: composite
1717
steps:
1818
- name: Install Rust toolchain
19-
uses: dtolnay/rust-toolchain@v1
19+
uses: dtolnay/rust-toolchain@master
2020
with:
2121
toolchain: ${{ inputs.toolchain }}
2222
target: ${{ inputs.target }}
@@ -26,4 +26,4 @@ runs:
2626
run: echo "::add-matcher::.github/actions/setup-rust/rust.json"
2727
shell: bash
2828

29-
- uses: Swatinem/rust-cache@v2.1.0
29+
- uses: Swatinem/rust-cache@v2.2.0

.github/workflows/changelog.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ jobs:
1414

1515
- name: Get Changed Files
1616
id: files
17-
uses: Ana06/get-changed-files@v2.1.0
17+
uses: tj-actions/changed-files@v34
1818
with:
19-
# use JSON so we don't have to worry about filenames with spaces
20-
format: 'json'
21-
filter: '.changes/*.json'
19+
separator: ';'
20+
files: |
21+
.changes/*.json
2222
2323
- name: Validate Changelog Files
2424
id: changelog
2525
run: |
2626
set -x
2727
set -e
28-
readarray -t added_modified < <(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')
29-
readarray -t removed < <(jq -r '.[]' <<<'${{ steps.files.outputs.removed }}')
28+
readarray -d ';' -t added_modified <<< '${{ steps.files.outputs.all_changed_files }}'
29+
readarray -d ';' -t removed <<< '${{ steps.files.outputs.deleted_files }}'
3030
added_count=${#added_modified[@]}
3131
removed_count=${#removed[@]}
3232
if ${{ !contains(github.event.pull_request.labels.*.name, 'no changelog' ) }}; then

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/checkout@v3
1919

2020
- name: Run ShellCheck
21-
uses: azohra/shell-linter@v0.3.0
21+
uses: azohra/shell-linter@v0.6.0
2222

2323
cargo-deny:
2424
runs-on: ubuntu-latest
@@ -119,7 +119,7 @@ jobs:
119119

120120
- name: Set up Docker Buildx
121121
if: runner.os == 'Linux'
122-
uses: docker/setup-buildx-action@v1
122+
uses: docker/setup-buildx-action@v2
123123

124124
- name: Build xtask
125125
run: cargo build -p xtask
@@ -205,7 +205,7 @@ jobs:
205205

206206
- name: Login to GitHub Container Registry
207207
if: steps.prepare-meta.outputs.has-image
208-
uses: docker/login-action@v1
208+
uses: docker/login-action@v2
209209
with:
210210
registry: ghcr.io
211211
username: ${{ github.actor }}
@@ -385,7 +385,7 @@ jobs:
385385
with:
386386
path: ${{ runner.temp }}/artifacts
387387
- name: Grab PR number
388-
run: echo "::set-output name=pr::"$(echo $commit_message | sed -ne 's/.*\#\(.*\):/\1/p')
388+
run: echo "pr=$(echo ${commit_message} | sed -ne 's/.*#\(.*\):/\1/p')" >> $GITHUB_OUTPUT
389389
id: pr-number
390390
if: ${{ !github.event.pull_request.number }}
391391
env:

.github/workflows/weekly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/checkout@v3
1919
- uses: ./.github/actions/setup-rust
2020
- name: Set up Docker Buildx
21-
uses: docker/setup-buildx-action@v1
21+
uses: docker/setup-buildx-action@v2
2222
- name: Build xtask
2323
run: cargo build -p xtask
2424
- name: Build Docker image

xtask/src/build_docker_image.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ pub fn build_docker_image(
324324
}
325325
}
326326
if gha {
327-
gha_output("image", &tags[0]);
328-
gha_output("images", &format!("'{}'", serde_json::to_string(&tags)?));
327+
gha_output("image", &tags[0])?;
328+
gha_output("images", &format!("'{}'", serde_json::to_string(&tags)?))?;
329329
if targets.len() > 1 {
330330
gha_print("::endgroup::");
331331
}

xtask/src/ci.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub fn ci(args: CiJob, metadata: CargoMetadata) -> cross::Result<()> {
6363
chrono::Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Millis, true)
6464
));
6565

66-
gha_output("labels", &serde_json::to_string(&labels.join("\n"))?);
66+
gha_output("labels", &serde_json::to_string(&labels.join("\n"))?)?;
6767

6868
let version = cross_meta.version.clone();
6969

@@ -78,15 +78,15 @@ pub fn ci(args: CiJob, metadata: CargoMetadata) -> cross::Result<()> {
7878
false,
7979
&version,
8080
)?[0],
81-
);
81+
)?;
8282

8383
if target.has_ci_image() {
84-
gha_output("has-image", "true")
84+
gha_output("has-image", "true")?
8585
}
8686
if target.is_standard_target_image() {
87-
gha_output("test-variant", "default")
87+
gha_output("test-variant", "default")?
8888
} else {
89-
gha_output("test-variant", &target.name)
89+
gha_output("test-variant", &target.name)?
9090
}
9191
}
9292
CiJob::Check { ref_type, ref_name } => {
@@ -110,7 +110,7 @@ pub fn ci(args: CiJob, metadata: CargoMetadata) -> cross::Result<()> {
110110
.ok_or_else(|| eyre::eyre!("cargo search returned unexpected data"))?,
111111
)?;
112112
if version >= latest_version && version.pre.is_empty() {
113-
gha_output("is-latest", "true")
113+
gha_output("is-latest", "true")?
114114
}
115115
}
116116
}

0 commit comments

Comments
 (0)