ci: make sign seperate step
This commit is contained in:
parent
204a94ed89
commit
8808493cfb
56
.github/workflows/release.yml
vendored
56
.github/workflows/release.yml
vendored
@ -77,35 +77,59 @@ jobs:
|
|||||||
cp "target/$TARGET/release/pumpkin" "dist/pumpkin-${{ runner.arch }}-${{ runner.os }}-musl"
|
cp "target/$TARGET/release/pumpkin" "dist/pumpkin-${{ runner.arch }}-${{ runner.os }}-musl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload unsigned executable for SignPath (Windows only)
|
- name: Upload unsigned Windows executable
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
id: upload_unsigned
|
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: unsigned-${{ runner.arch }}-${{ runner.os }}
|
name: unsigned-${{ runner.arch }}-${{ runner.os }}
|
||||||
path: dist/pumpkin-*
|
path: dist/pumpkin-*
|
||||||
retention-days: 1
|
retention-days: 14
|
||||||
|
|
||||||
- name: Submit SignPath signing request (Windows only)
|
- name: Export executable
|
||||||
if: runner.os == 'Windows'
|
if: runner.os != 'Windows'
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: pumpkin-${{ runner.arch }}-${{ runner.os }}
|
||||||
|
compression-level: 9
|
||||||
|
path: dist/pumpkin-*
|
||||||
|
|
||||||
|
sign_windows_release:
|
||||||
|
name: Sign Windows release
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
needs: build_release
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- windows-latest
|
||||||
|
- windows-11-arm
|
||||||
|
steps:
|
||||||
|
- name: Find unsigned artifact
|
||||||
|
id: artifact
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
ARTIFACT_NAME: unsigned-${{ runner.arch }}-${{ runner.os }}
|
||||||
|
run: |
|
||||||
|
ARTIFACT_ID=$(gh api \
|
||||||
|
"repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts" \
|
||||||
|
--jq '.artifacts | map(select(.name == env.ARTIFACT_NAME and .expired == false)) | first.id')
|
||||||
|
test -n "$ARTIFACT_ID"
|
||||||
|
echo "id=$ARTIFACT_ID" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Submit SignPath signing request
|
||||||
uses: signpath/github-action-submit-signing-request@v2
|
uses: signpath/github-action-submit-signing-request@v2
|
||||||
with:
|
with:
|
||||||
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
|
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
|
||||||
organization-id: '${{ secrets.SIGNPATH_ORGANIZATION_ID }}'
|
organization-id: '${{ secrets.SIGNPATH_ORGANIZATION_ID }}'
|
||||||
project-slug: '${{ secrets.SIGNPATH_PROJECT_SLUG }}'
|
project-slug: '${{ secrets.SIGNPATH_PROJECT_SLUG }}'
|
||||||
signing-policy-slug: '${{ secrets.SIGNPATH_RELEASE_SIGNING_POLICY_SLUG || secrets.SIGNPATH_SIGNING_POLICY_SLUG }}'
|
signing-policy-slug: '${{ secrets.SIGNPATH_RELEASE_SIGNING_POLICY_SLUG || secrets.SIGNPATH_SIGNING_POLICY_SLUG }}'
|
||||||
github-artifact-id: '${{ steps.upload_unsigned.outputs.artifact-id }}'
|
github-artifact-id: '${{ steps.artifact.outputs.id }}'
|
||||||
wait-for-completion: true
|
wait-for-completion: true
|
||||||
output-artifact-directory: dist/signed/
|
output-artifact-directory: dist/
|
||||||
|
|
||||||
- name: Overwrite with signed version (Windows only)
|
- name: Export signed executable
|
||||||
if: runner.os == 'Windows'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cp dist/signed/* dist/
|
|
||||||
rm -rf dist/signed/
|
|
||||||
|
|
||||||
- name: Export executable
|
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: pumpkin-${{ runner.arch }}-${{ runner.os }}
|
name: pumpkin-${{ runner.arch }}-${{ runner.os }}
|
||||||
@ -148,7 +172,7 @@ jobs:
|
|||||||
name: Publish GitHub Release
|
name: Publish GitHub Release
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
needs: [build_release, build_android_release]
|
needs: [build_release, sign_windows_release, build_android_release]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user