Skip to content

Commit

Permalink
Merge pull request #1 from ankitects/ci-fix
Browse files Browse the repository at this point in the history
fix: broken CI due to deprecated github action artifact usage
  • Loading branch information
dae authored Dec 17, 2024
2 parents 44f2c17 + 5361cb6 commit 77242fa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
];
}
}
Expand All @@ -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}`,
Expand All @@ -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",
Expand All @@ -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
// {
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
Expand Down Expand Up @@ -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
Expand All @@ -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: |-
Expand All @@ -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:
Expand Down

0 comments on commit 77242fa

Please sign in to comment.