2023-01-09 17:02:50 +00:00
|
|
|
name: Release PR
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types:
|
|
|
|
- opened
|
|
|
|
- reopened
|
|
|
|
- synchronize
|
|
|
|
- labeled
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
2023-02-02 18:39:45 +00:00
|
|
|
concurrency: release
|
2023-01-09 17:02:50 +00:00
|
|
|
# Only intra-repo PRs are allowed to have PR artifacts uploaded
|
2023-05-22 19:39:27 +00:00
|
|
|
# We only want to trigger once the upload once in the case the upload label is added, not when any label is added
|
|
|
|
if: |
|
|
|
|
github.event.pull_request.head.repo.full_name == 'DeterminateSystems/nix-installer'
|
|
|
|
&& (
|
|
|
|
(github.event.action == 'labeled' && github.event.label.name == 'upload to s3')
|
|
|
|
|| (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'upload to s3'))
|
|
|
|
)
|
2023-01-09 17:02:50 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
id-token: write # In order to request a JWT for AWS auth
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Download Buildkite Artifacts
|
|
|
|
uses: EnricoMi/download-buildkite-artifact-action@v1.14
|
|
|
|
with:
|
|
|
|
buildkite_token: ${{ secrets.BUILDKITE_TOKEN }}
|
|
|
|
output_path: artifacts
|
|
|
|
- name: Configure AWS Credentials
|
2023-04-11 15:52:07 +00:00
|
|
|
uses: aws-actions/configure-aws-credentials@v2
|
2023-01-09 17:02:50 +00:00
|
|
|
with:
|
|
|
|
role-to-assume: ${{ secrets.AWS_S3_UPLOAD_ROLE }}
|
|
|
|
aws-region: us-east-2
|
|
|
|
- name: Publish Release (PR)
|
|
|
|
env:
|
|
|
|
AWS_BUCKET: ${{ secrets.AWS_S3_UPLOAD_BUCKET }}
|
|
|
|
run: |
|
|
|
|
PR="pr_${{ github.event.pull_request.number }}"
|
2023-01-09 20:38:53 +00:00
|
|
|
GIT_ISH="${{ github.event.pull_request.head.sha }}"
|
2023-01-20 17:42:14 +00:00
|
|
|
./upload_s3.sh "$PR" "$GIT_ISH" "https://install.determinate.systems/nix/rev/$GIT_ISH"
|
2023-01-20 19:13:05 +00:00
|
|
|
- name: Install Instructions (PR)
|
|
|
|
run: |
|
|
|
|
cat <<EOF
|
|
|
|
This commit can be installed by running the following command:
|
|
|
|
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/rev/${{ github.event.pull_request.head.sha }} | sh -s -- install
|
|
|
|
|
|
|
|
The latest commit from this PR can be installed by running the following command:
|
|
|
|
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/pr/${{ github.event.pull_request.number }} | sh -s -- install
|
|
|
|
EOF
|