-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
224 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Download artifact | ||
description: Download and decrypt an artifact. | ||
|
||
inputs: | ||
name: | ||
description: 'The name of the artifact.' | ||
required: true | ||
path: | ||
description: 'Download to a specified path.' | ||
required: false | ||
default: ./ | ||
encryption-secret: | ||
description: 'The secret to use for decrypting the artifact.' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install unzip | ||
uses: ./.github/actions/setup_bazel_nix | ||
with: | ||
nixTools: | | ||
unzip | ||
- name: Create temporary directory | ||
id: tempdir | ||
shell: bash | ||
run: echo "directory=$(mktemp -d)" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Download the artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ inputs.name }} | ||
path: ${{ steps.tempdir.outputs.directory }} | ||
|
||
- name: Decrypt and unzip archive | ||
shell: bash | ||
run: | | ||
unzip -P '${{ inputs.encryption-secret }}' -qq -d ${{ inputs.path }} ${{ steps.tempdir.outputs.directory }}/archive.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Upload artifact | ||
description: Upload an encrypted zip archive as a github artifact. | ||
|
||
inputs: | ||
path: | ||
description: 'The path(s) that should be uploaded. Those are evaluated with bash and the extglob option.' | ||
required: true | ||
name: | ||
description: 'The name of the artifact.' | ||
required: true | ||
retention-days: | ||
description: 'How long the artifact should be retained for.' | ||
default: 60 | ||
encryption-secret: | ||
description: 'The secret to use for encrypting the files.' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install zip | ||
uses: ./.github/actions/setup_bazel_nix | ||
with: | ||
nixTools: | | ||
zip | ||
- name: Create temporary directory | ||
id: tempdir | ||
shell: bash | ||
run: echo "directory=$(mktemp -d)" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Create archive | ||
shell: bash | ||
run: | | ||
shopt -s extglob | ||
# Check if any file matches the given pattern(s). | ||
something_exists=false | ||
for pattern in ${{ inputs.path }}; do | ||
if compgen -G $pattern > /dev/null; then | ||
something_exists=true | ||
fi | ||
done | ||
# Create an archive if files exist. | ||
# Don't create an archive file if no files are found | ||
# and warn. | ||
if $something_exists; then | ||
zip -e -P '${{ inputs.encryption-secret }}' -qq -r ${{ steps.tempdir.outputs.directory }}/archive.zip ${{ inputs.path }} | ||
else | ||
echo "::warning:: No files/directories found with the provided path(s) $(echo -n ${{ inputs.path }}). No artifact will be uploaded." | ||
fi | ||
- name: Upload archive as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.name }} | ||
path: ${{ steps.tempdir.outputs.directory }}/archive.zip | ||
retention-days: ${{ inputs.retention-days }} | ||
if-no-files-found: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,69 @@ | ||
name: Download release binaries | ||
description: "Downloads all binaries created by a different job (and therefore not available in this job) in the release pipeline." | ||
inputs: | ||
encryption-secret: | ||
description: 'The secret to use for decrypting the artifact.' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Download CLI binaries darwin-amd64 | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
uses: ./.github/actions/artifact_download | ||
with: | ||
name: constellation-darwin-amd64 | ||
encryption-secret: ${{ inputs.encryption-secret }} | ||
|
||
- name: Download CLI binaries darwin-arm64 | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
uses: ./.github/actions/artifact_download | ||
with: | ||
name: constellation-darwin-arm64 | ||
encryption-secret: ${{ inputs.encryption-secret }} | ||
|
||
- name: Download CLI binaries linux-amd64 | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
uses: ./.github/actions/artifact_download | ||
with: | ||
name: constellation-linux-amd64 | ||
encryption-secret: ${{ inputs.encryption-secret }} | ||
|
||
- name: Download CLI binaries linux-arm64 | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
uses: ./.github/actions/artifact_download | ||
with: | ||
name: constellation-linux-arm64 | ||
encryption-secret: ${{ inputs.encryption-secret }} | ||
|
||
- name: Download CLI binaries windows-amd64 | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
uses: ./.github/actions/artifact_download | ||
with: | ||
name: constellation-windows-amd64 | ||
encryption-secret: ${{ inputs.encryption-secret }} | ||
|
||
- name: Download Terraform module | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
uses: ./.github/actions/artifact_download | ||
with: | ||
name: terraform-module | ||
encryption-secret: ${{ inputs.encryption-secret }} | ||
|
||
- name: Download Terraform provider binary darwin-amd64 | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
uses: ./.github/actions/artifact_download | ||
with: | ||
name: terraform-provider-constellation-darwin-amd64 | ||
encryption-secret: ${{ inputs.encryption-secret }} | ||
|
||
- name: Download Terraform provider binary darwin-arm64 | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
uses: ./.github/actions/artifact_download | ||
with: | ||
name: terraform-provider-constellation-darwin-arm64 | ||
encryption-secret: ${{ inputs.encryption-secret }} | ||
|
||
- name: Download Terraform provider binary linux-amd64 | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
uses: ./.github/actions/artifact_download | ||
with: | ||
name: terraform-provider-constellation-linux-amd64 | ||
encryption-secret: ${{ inputs.encryption-secret }} | ||
|
||
- name: Download Terraform provider binary linux-arm64 | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
uses: ./.github/actions/artifact_download | ||
with: | ||
name: terraform-provider-constellation-linux-arm64 | ||
encryption-secret: ${{ inputs.encryption-secret }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.