Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Sign binaries in separate step, not run on forks #1032

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ zip_dist() {
pkgname="${pkgname:-"$1-$VERSION-$OS_TAG-x86_64"}"
mv dist "$pkgname"
tar -czf "$pkgname".tar.gz "$pkgname"
sign "$pkgname".tar.gz
[[ -f "$pkgname".tar.gz.sig ]] && [[ -f "$pkgname".tar.gz ]]
rm -rf dist
}

Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/crux-llvm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,29 @@ jobs:
LLVM_LINK: "${{ github.workspace }}/llvm/bin/llvm-link"
CLANG: "${{ github.workspace }}/llvm/bin/clang-withIncl"

- shell: bash
run: .github/ci.sh bundle_crux_llvm_files
- name: Create binary artifact
shell: bash
run: |
NAME="crux-llvm-${{ needs.outputs.outputs.crux-llvm-version }}-${{ matrix.os }}-x86_64"
echo "NAME=$NAME" >> $GITHUB_ENV
.github/ci.sh bundle_crux_llvm_files
if: github.repository == 'GaloisInc/crucible'
env:
OS_TAG: ${{ matrix.os }}
VERSION: ${{ needs.outputs.outputs.crux-llvm-version }}

- name: Sign binary artifact
# The SIGNING_PASSPHRASE and SIGNING_KEY secrets are only available on
# jobs run from the main repo, and as a result, they won't work when
# run from a fork. Signing binaries isn't essential to the rest of the
# workflow, so it is safe to skip this step on forks.
if: github.event.pull_request.head.repo.fork == false
shell: bash
env:
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
VERSION: ${{ needs.outputs.outputs.crux-llvm-version }}
run: |
.github/ci.sh sign "${NAME}.tar.gz"

- uses: actions/upload-artifact@v2
if: github.repository == 'GaloisInc/crucible'
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/crux-mir-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,29 @@ jobs:
- shell: bash
run: .github/ci.sh test crux-mir

- shell: bash
run: .github/ci.sh bundle_crux_mir_files
- name: Create binary artifact
shell: bash
run: |
NAME="crux-mir-${{ needs.outputs.outputs.crux-mir-version }}-${{ matrix.os }}-x86_64"
echo "NAME=$NAME" >> $GITHUB_ENV
RyanGlScott marked this conversation as resolved.
Show resolved Hide resolved
.github/ci.sh bundle_crux_mir_files
if: github.repository == 'GaloisInc/crucible'
env:
OS_TAG: ${{ matrix.os }}
VERSION: ${{ needs.outputs.outputs.crux-mir-version }}

- name: Sign binary artifact
# The SIGNING_PASSPHRASE and SIGNING_KEY secrets are only available on
# jobs run from the main repo, and as a result, they won't work when
# run from a fork. Signing binaries isn't essential to the rest of the
# workflow, so it is safe to skip this step on forks.
if: github.event.pull_request.head.repo.fork == false
shell: bash
env:
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
VERSION: ${{ needs.outputs.outputs.crux-mir-version }}
run: |
.github/ci.sh sign "${NAME}.tar.gz"

- uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/heads/release-')
Expand Down