From a332a70bf150d779b0f59282db271faa402cf299 Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Tue, 10 Dec 2024 10:16:04 +0000 Subject: [PATCH 1/3] fix: broken CI due to deprecated github action artifact usage --- .github/workflows/ci.generate.ts | 14 +++++++------- .github/workflows/ci.yml | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index fd04581..00e18e7 100644 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -167,18 +167,18 @@ const ci = { return [ `cd target/${profile.target}/release`, `zip -r ${profile.zipFileName} dprint-plugin-prettier`, - `echo \"::set-output name=ZIP_CHECKSUM::$(shasum -a 256 ${profile.zipFileName} | awk '{print $1}')\"`, + `echo \"ZIP_CHECKSUM=$(shasum -a 256 ${profile.zipFileName} | awk '{print $1}')\" >> $GITHUB_OUTPUT`, ]; case Runner.Linux: return [ `cd target/${profile.target}/release`, `zip -r ${profile.zipFileName} dprint-plugin-prettier`, - `echo \"::set-output name=ZIP_CHECKSUM::$(shasum -a 256 ${profile.zipFileName} | awk '{print $1}')\"`, + `echo \"ZIP_CHECKSUM=$(shasum -a 256 ${profile.zipFileName} | awk '{print $1}')\" >> $GITHUB_OUTPUT`, ]; case Runner.Windows: return [ `Compress-Archive -CompressionLevel Optimal -Force -Path target/${profile.target}/release/dprint-plugin-prettier.exe -DestinationPath target/${profile.target}/release/${profile.zipFileName}`, - `echo "::set-output name=ZIP_CHECKSUM::$(shasum -a 256 target/${profile.target}/release/${profile.zipFileName} | awk '{print $1}')"`, + `echo "ZIP_CHECKSUM=$(shasum -a 256 target/${profile.target}/release/${profile.zipFileName} | awk '{print $1}')" >> $GITHUB_OUTPUT`, ]; } } @@ -194,7 +194,7 @@ const ci = { return { name: `Upload artifacts (${profile.target})`, if: `matrix.config.target == '${profile.target}' && startsWith(github.ref, 'refs/tags/')`, - uses: "actions/upload-artifact@v2", + uses: "actions/upload-artifact@v4", with: { name: profile.artifactsName, path: `target/${profile.target}/release/${profile.zipFileName}`, @@ -210,7 +210,7 @@ const ci = { "runs-on": "ubuntu-latest", steps: [ { name: "Checkout", uses: "actions/checkout@v2" }, - { name: "Download artifacts", uses: "actions/download-artifact@v2" }, + { name: "Download artifacts", uses: "actions/download-artifact@v4" }, { uses: "denoland/setup-deno@v1" }, { name: "Move downloaded artifacts to root directory", @@ -231,12 +231,12 @@ const ci = { { name: "Get tag version", id: "get_tag_version", - run: "echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\\/tags\\//}", + run: "echo TAG_VERSION=${GITHUB_REF/refs\\/tags\\//} >> $GITHUB_OUTPUT", }, { name: "Get plugin file checksum", id: "get_plugin_file_checksum", - run: "echo \"::set-output name=CHECKSUM::$(shasum -a 256 plugin.json | awk '{print $1}')\"", + run: "echo \"CHECKSUM=$(shasum -a 256 plugin.json | awk '{print $1}')\" >> $GITHUB_OUTPUT", }, // todo: implement this // { diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 149319d..62982b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: dsherret/rust-toolchain-file@v1 - name: Cache cargo - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@v4 with: prefix-key: "v3-${{matrix.config.target}}" save-if: "${{ github.ref == 'refs/heads/main' }}" @@ -98,61 +98,61 @@ jobs: run: |- cd target/x86_64-apple-darwin/release zip -r dprint-plugin-prettier-x86_64-apple-darwin.zip dprint-plugin-prettier - echo "::set-output name=ZIP_CHECKSUM::$(shasum -a 256 dprint-plugin-prettier-x86_64-apple-darwin.zip | awk '{print $1}')" + echo "ZIP_CHECKSUM=$(shasum -a 256 dprint-plugin-prettier-x86_64-apple-darwin.zip | awk '{print $1}')" >> $GITHUB_OUTPUT - name: Pre-release (aarch64-apple-darwin) id: pre_release_aarch64_apple_darwin if: "matrix.config.target == 'aarch64-apple-darwin' && startsWith(github.ref, 'refs/tags/')" run: |- cd target/aarch64-apple-darwin/release zip -r dprint-plugin-prettier-aarch64-apple-darwin.zip dprint-plugin-prettier - echo "::set-output name=ZIP_CHECKSUM::$(shasum -a 256 dprint-plugin-prettier-aarch64-apple-darwin.zip | awk '{print $1}')" + echo "ZIP_CHECKSUM=$(shasum -a 256 dprint-plugin-prettier-aarch64-apple-darwin.zip | awk '{print $1}')" >> $GITHUB_OUTPUT - name: Pre-release (x86_64-pc-windows-msvc) id: pre_release_x86_64_pc_windows_msvc if: "matrix.config.target == 'x86_64-pc-windows-msvc' && startsWith(github.ref, 'refs/tags/')" run: |- Compress-Archive -CompressionLevel Optimal -Force -Path target/x86_64-pc-windows-msvc/release/dprint-plugin-prettier.exe -DestinationPath target/x86_64-pc-windows-msvc/release/dprint-plugin-prettier-x86_64-pc-windows-msvc.zip - echo "::set-output name=ZIP_CHECKSUM::$(shasum -a 256 target/x86_64-pc-windows-msvc/release/dprint-plugin-prettier-x86_64-pc-windows-msvc.zip | awk '{print $1}')" + echo "ZIP_CHECKSUM=$(shasum -a 256 target/x86_64-pc-windows-msvc/release/dprint-plugin-prettier-x86_64-pc-windows-msvc.zip | awk '{print $1}')" >> $GITHUB_OUTPUT - name: Pre-release (x86_64-unknown-linux-gnu) id: pre_release_x86_64_unknown_linux_gnu if: "matrix.config.target == 'x86_64-unknown-linux-gnu' && startsWith(github.ref, 'refs/tags/')" run: |- cd target/x86_64-unknown-linux-gnu/release zip -r dprint-plugin-prettier-x86_64-unknown-linux-gnu.zip dprint-plugin-prettier - echo "::set-output name=ZIP_CHECKSUM::$(shasum -a 256 dprint-plugin-prettier-x86_64-unknown-linux-gnu.zip | awk '{print $1}')" + echo "ZIP_CHECKSUM=$(shasum -a 256 dprint-plugin-prettier-x86_64-unknown-linux-gnu.zip | awk '{print $1}')" >> $GITHUB_OUTPUT - name: Pre-release (aarch64-unknown-linux-gnu) id: pre_release_aarch64_unknown_linux_gnu if: "matrix.config.target == 'aarch64-unknown-linux-gnu' && startsWith(github.ref, 'refs/tags/')" run: |- cd target/aarch64-unknown-linux-gnu/release zip -r dprint-plugin-prettier-aarch64-unknown-linux-gnu.zip dprint-plugin-prettier - echo "::set-output name=ZIP_CHECKSUM::$(shasum -a 256 dprint-plugin-prettier-aarch64-unknown-linux-gnu.zip | awk '{print $1}')" + echo "ZIP_CHECKSUM=$(shasum -a 256 dprint-plugin-prettier-aarch64-unknown-linux-gnu.zip | awk '{print $1}')" >> $GITHUB_OUTPUT - name: Upload artifacts (x86_64-apple-darwin) if: "matrix.config.target == 'x86_64-apple-darwin' && startsWith(github.ref, 'refs/tags/')" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: x86_64-apple-darwin-artifacts path: target/x86_64-apple-darwin/release/dprint-plugin-prettier-x86_64-apple-darwin.zip - name: Upload artifacts (aarch64-apple-darwin) if: "matrix.config.target == 'aarch64-apple-darwin' && startsWith(github.ref, 'refs/tags/')" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: aarch64-apple-darwin-artifacts path: target/aarch64-apple-darwin/release/dprint-plugin-prettier-aarch64-apple-darwin.zip - name: Upload artifacts (x86_64-pc-windows-msvc) if: "matrix.config.target == 'x86_64-pc-windows-msvc' && startsWith(github.ref, 'refs/tags/')" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: x86_64-pc-windows-msvc-artifacts path: target/x86_64-pc-windows-msvc/release/dprint-plugin-prettier-x86_64-pc-windows-msvc.zip - name: Upload artifacts (x86_64-unknown-linux-gnu) if: "matrix.config.target == 'x86_64-unknown-linux-gnu' && startsWith(github.ref, 'refs/tags/')" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: x86_64-unknown-linux-gnu-artifacts path: target/x86_64-unknown-linux-gnu/release/dprint-plugin-prettier-x86_64-unknown-linux-gnu.zip - name: Upload artifacts (aarch64-unknown-linux-gnu) if: "matrix.config.target == 'aarch64-unknown-linux-gnu' && startsWith(github.ref, 'refs/tags/')" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: aarch64-unknown-linux-gnu-artifacts path: target/aarch64-unknown-linux-gnu/release/dprint-plugin-prettier-aarch64-unknown-linux-gnu.zip @@ -165,7 +165,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Download artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 - uses: denoland/setup-deno@v1 - name: Move downloaded artifacts to root directory run: |- @@ -185,10 +185,10 @@ jobs: run: deno run -A scripts/create_plugin_file.ts - name: Get tag version id: get_tag_version - run: 'echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}' + run: 'echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT' - name: Get plugin file checksum id: get_plugin_file_checksum - run: 'echo "::set-output name=CHECKSUM::$(shasum -a 256 plugin.json | awk ''{print $1}'')"' + run: 'echo "CHECKSUM=$(shasum -a 256 plugin.json | awk ''{print $1}'')" >> $GITHUB_OUTPUT' - name: Release uses: softprops/action-gh-release@v1 env: From fbcd8b2f4dd8f76159c3c85cd71937bbc8f4d42c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 17 Dec 2024 21:39:33 +1100 Subject: [PATCH 2/3] rust-cache@v4 does not exist --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62982b8..fe4cf07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: dsherret/rust-toolchain-file@v1 - name: Cache cargo - uses: Swatinem/rust-cache@v4 + uses: Swatinem/rust-cache@v2 with: prefix-key: "v3-${{matrix.config.target}}" save-if: "${{ github.ref == 'refs/heads/main' }}" From 5361cb6e97eab2fde6e0934cbd2299057f193b99 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 17 Dec 2024 21:48:34 +1100 Subject: [PATCH 3/3] Don't let cross deps float Latest home package doesn't build on pinned Rust version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe4cf07..ea6590b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: if: matrix.config.cross == 'true' run: |- deno task build - cargo install cross --git https://github.com/cross-rs/cross --rev 44011c8854cb2eaac83b173cc323220ccdff18ea + cargo install cross --git https://github.com/cross-rs/cross --rev 44011c8854cb2eaac83b173cc323220ccdff18ea --locked - name: Build (Debug) if: "matrix.config.cross != 'true' && !startsWith(github.ref, 'refs/tags/')" run: "cargo build --locked --all-targets --target ${{matrix.config.target}}"