-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: adds tooling for uploading to object storage
- Loading branch information
Showing
11 changed files
with
179 additions
and
67 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Upload | ||
on: | ||
workflow_call: | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
jobs: | ||
upload: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: ./.github/actions/setup | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: archives | ||
path: archives | ||
- uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: us-east-1 | ||
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | ||
- run: just upload |
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
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,18 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
if [ "${DEBUG:-false}" = true ]; | ||
then | ||
set -x | ||
fi | ||
|
||
if [ "$#" -ne 2 ]; then | ||
echo "usage: $0 <cmd> <version>" | ||
exit 1 | ||
fi | ||
|
||
cmd=$1 | ||
version=$2 | ||
|
||
name=$(basename "$cmd") | ||
|
||
printf "$(pwd)/packages/%s" "$name-$version.vsix" |
This file was deleted.
Oops, something went wrong.
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,59 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
if [ "${DEBUG:-false}" = true ]; | ||
then | ||
set -x | ||
fi | ||
|
||
cmd=$1 | ||
if [[ -z "$cmd" ]]; then | ||
echo "usage: $0 <cmd>" | ||
exit 1 | ||
fi | ||
echo "Command: $cmd" 1>&2 | ||
|
||
version=$(./scripts/get-version.bash) | ||
echo "Version: $version" 1>&2 | ||
|
||
name=$(basename "$cmd") | ||
echo "Name: $name" 1>&2 | ||
|
||
ref="${GITHUB_REF}" | ||
echo "Git Reference: $ref" 1>&2 | ||
echo "Git Commit Hash: $(git show-ref --heads --hash "$ref")" | ||
ref=${ref#"refs/"} | ||
|
||
object_path="s3://posit-publisher/$name/releases/$ref" | ||
echo "Object Path: $object_path" 1>&2 | ||
|
||
platforms=() | ||
while IFS='' read -r line; do platforms+=("$line"); done < <(./scripts/get-platforms.bash) | ||
for platform in "${platforms[@]}" | ||
do | ||
echo | ||
echo "Release: $platform" 1>&2 | ||
os=${platform/\/*} # retain the part before the slash | ||
arch=${platform/*\/} # retain the part after the slash | ||
archive=$(./scripts/get-archive-path.bash "$name" "$version" "$os" "$arch" ) | ||
echo "Archive: $archive" 1>&2 | ||
if ! [ -f "$archive" ]; | ||
then | ||
echo "Not Found. Skipping..." 1>&2 | ||
else | ||
object="$object_path/$(basename "$archive")" | ||
echo "Object: $object" 1>&2 | ||
aws s3 cp "$archive" "$object" > /dev/null 2>&1 | ||
fi | ||
done | ||
|
||
extension=$(./scripts/get-vscode-extension-path.bash "$name" "$version") | ||
echo | ||
echo "VSCode Extension: $extension" | ||
if ! [ -f "$extension" ]; | ||
then | ||
echo "Not Found. Skipping..." 1>&2 | ||
else | ||
object="$object_path/$(basename "$extension")" | ||
echo "Object: $object" 1>&2 | ||
aws s3 cp "$extension" "$object" > /dev/null 2>&1 | ||
fi |