Skip to content

Commit

Permalink
Fix CI workflow for {upload,download}-artifact actions v4
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Jan 8, 2024
1 parent 636c9e3 commit be3aee4
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- master
- official-actions-8204c6933e
tags:
- "jq-*"
pull_request:
Expand Down Expand Up @@ -115,7 +116,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: jq-linux
name: jq-${{ env.SUFFIX }}
path: jq-${{ env.SUFFIX }}
if-no-files-found: error
retention-days: 7
Expand Down Expand Up @@ -182,7 +183,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: jq-macos
name: jq-${{ env.SUFFIX }}
path: jq-${{ env.SUFFIX }}
if-no-files-found: error
retention-days: 7
Expand Down Expand Up @@ -256,7 +257,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: jq-windows
name: jq-${{ env.SUFFIX }}
path: jq-${{ env.SUFFIX }}.exe
if-no-files-found: error
retention-days: 7
Expand Down Expand Up @@ -303,7 +304,8 @@ jobs:
- name: Download executables
uses: actions/download-artifact@v4
with:
name: jq-linux
pattern: jq-linux-*
merge-multiple: true
- name: Move executables
run: |
mkdir -p linux/{386,amd64,arm64,mips64le,ppc64le,riscv64,s390x}
Expand Down Expand Up @@ -365,17 +367,19 @@ jobs:
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Upload release
env:
TAG_NAME: ${{ github.ref_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cp jq-linux/{jq-linux-amd64,jq-linux64}
cp jq-macos/{jq-macos-amd64,jq-osx-amd64}
cp jq-windows/{jq-windows-amd64.exe,jq-win64.exe}
sha256sum jq-*/jq-* | sed 's| .*/| |' > sha256sum.txt
cp jq-linux-amd64 jq-linux64
cp jq-macos-amd64 jq-osx-amd64
cp jq-windows-amd64.exe jq-win64.exe
sha256sum jq-* > sha256sum.txt
gh release create "$TAG_NAME" --draft --title "jq ${TAG_NAME#jq-}" --generate-notes
gh release upload "$TAG_NAME" --clobber jq-*/jq-* sha256sum.txt
gh release upload "$TAG_NAME" --clobber jq-* sha256sum.txt
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
Expand All @@ -389,7 +393,7 @@ jobs:
sig_dir="sig/v${TAG_NAME#jq-}"
mkdir -p "$sig_dir"
mv sha256sum.txt "$sig_dir"
for file in jq-*/jq-*; do
for file in jq-*; do
gpg --detach-sign --armor --batch --output "${sig_dir}/${file#*/}.asc" "$file"
done
git add sig
Expand Down

0 comments on commit be3aee4

Please sign in to comment.