Skip to content

Commit

Permalink
feat(ci): pr-build flag to build artifacts for a pr manually if needed
Browse files Browse the repository at this point in the history
Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Sep 12, 2023
1 parent 23e92ba commit 357be35
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/prebuilt-pr.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Build PR binaries
name: Create PR artifacts

on:
workflow_dispatch:
pull_request:
types: [labeled]
branches:
- main
paths-ignore:
- "**/*.md"
- "docs/**/*"
workflow_dispatch:

env:
BINARY_NAME: rustic-server
Expand All @@ -16,6 +17,7 @@ jobs:
pr-build:
name: Build PR on ${{ matrix.job.target }}
runs-on: ${{ matrix.job.os }}
if: ${{ github.event.label.name == 'S-build' }}
strategy:
matrix:
rust: [stable]
Expand Down Expand Up @@ -92,9 +94,29 @@ jobs:
binary-name: ${{ env.BINARY_NAME }}
package-secondary-name: ${{ matrix.job.target}}
github-token: ${{ secrets.GITHUB_TOKEN }}
gpg-release-private-key: ${{ secrets.GPG_RELEASE_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
github-ref: ${{ github.ref }}
sign-release: false
hash-release: true
use-project-version: false # not being used in rustic_server

remove-build-label:
name: Remove build label
needs: pr-build
permissions:
contents: read
issues: write
pull-requests: write
runs-on: ubuntu-latest
if: |
always() &&
! contains(needs.*.result, 'skipped')
steps:
- name: Remove label
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api \
--method DELETE \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/issues/${{ github.event.number }}/labels/S-build

0 comments on commit 357be35

Please sign in to comment.