-
Notifications
You must be signed in to change notification settings - Fork 2
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
build: adds tooling for uploading to object storage #673
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fa4f349
wip
tdstein 5fda99f
wip
tdstein a8cd4ba
build: adds tooling for uploading to object storage
tdstein 71abef8
Merge remote-tracking branch 'origin/main' into tdstein/524
tdstein 3dd5d9a
Merge remote-tracking branch 'origin/main' into tdstein/524
tdstein c331a76
fix: minor pull request feedback
tdstein ea3d3f0
Merge remote-tracking branch 'origin/main' into tdstein/524
tdstein 003dd28
build: adds upload support for multiplatform builds
tdstein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,27 @@ | ||
name: Upload | ||
on: | ||
workflow_call: | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
tdstein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
path: packages | ||
- 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
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" | ||
tdstein marked this conversation as resolved.
Show resolved
Hide resolved
|
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")" | ||
tdstein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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[@]}" | ||
tdstein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to do this for PR branches, or is this temporary to test this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit of both. If we don't want to save pull-request builds, we can delete it.