Skip to content

Commit da6a913

Browse files
yihaumergify[bot]
authored andcommitted
[anza migration] replace binaries backend (#6)
* ci: add upload-gcs-artifact * ci: publish release binaries to GCS * ci: redirect github repo to anza-xyz * ci: publish windows binaries to GCS * replace release.solana.com with release.anza.xyz * use a explicit name for credential (cherry picked from commit b061cd3)
1 parent 5b24097 commit da6a913

9 files changed

+48
-37
lines changed

.github/workflows/release-artifacts-auto.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ concurrency:
1414

1515
jobs:
1616
release-artifacts:
17-
if: github.repository == 'solana-labs/solana'
17+
if: github.repository == 'anza-xyz/agave'
1818
uses: ./.github/workflows/release-artifacts.yml
1919
with:
2020
commit: ${{ github.sha }}
2121
secrets:
22-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
23-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
24-
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
22+
GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL: ${{ secrets.GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL }}
2523

2624
error_reporting:
2725
needs:

.github/workflows/release-artifacts-manually.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ jobs:
1414
with:
1515
commit: ${{ github.event.inputs.commit }}
1616
secrets:
17-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
18-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
19-
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
17+
GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL: ${{ secrets.GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL }}

.github/workflows/release-artifacts.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ on:
77
required: false
88
type: string
99
secrets:
10-
AWS_ACCESS_KEY_ID:
11-
required: true
12-
AWS_SECRET_ACCESS_KEY:
13-
required: true
14-
AWS_S3_BUCKET:
10+
GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL:
1511
required: true
1612

1713
jobs:
@@ -71,17 +67,17 @@ jobs:
7167
shell: bash
7268
run: |
7369
FOLDER_NAME=${{ steps.build.outputs.tag || steps.build.outputs.channel }}
74-
mkdir -p "github-action-s3-upload/$FOLDER_NAME"
75-
cp -v "solana-release-x86_64-pc-windows-msvc.tar.bz2" "github-action-s3-upload/$FOLDER_NAME/"
76-
cp -v "solana-release-x86_64-pc-windows-msvc.yml" "github-action-s3-upload/$FOLDER_NAME/"
77-
cp -v "solana-install-init-x86_64-pc-windows-msvc"* "github-action-s3-upload/$FOLDER_NAME"
70+
mkdir -p "windows-release/$FOLDER_NAME"
71+
cp -v "solana-release-x86_64-pc-windows-msvc.tar.bz2" "windows-release/$FOLDER_NAME/"
72+
cp -v "solana-release-x86_64-pc-windows-msvc.yml" "windows-release/$FOLDER_NAME/"
73+
cp -v "solana-install-init-x86_64-pc-windows-msvc"* "windows-release/$FOLDER_NAME"
7874
7975
- name: Upload Artifacts
8076
if: ${{ steps.build.outputs.channel != '' || steps.build.outputs.tag != '' }}
8177
uses: actions/upload-artifact@v3
8278
with:
8379
name: windows-artifact
84-
path: github-action-s3-upload/
80+
path: windows-release/
8581

8682
windows-s3-upload:
8783
if: ${{ needs.windows-build.outputs.channel != '' || needs.windows-build.outputs.tag != '' }}
@@ -92,7 +88,16 @@ jobs:
9288
uses: actions/download-artifact@v3
9389
with:
9490
name: windows-artifact
95-
path: ./github-action-s3-upload
91+
path: .windows-release/
92+
93+
- name: Setup crediential
94+
uses: "google-github-actions/auth@v2"
95+
with:
96+
credentials_json: "${{ secrets.GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL }}"
97+
98+
- name: Upload files to GCS
99+
run: |
100+
gcloud storage cp --recursive windows-release/* gs://anza-release/
96101
97102
- name: Upload
98103
uses: jakejarvis/s3-sync-action@master
@@ -103,7 +108,7 @@ jobs:
103108
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
104109
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
105110
AWS_REGION: "us-west-1"
106-
SOURCE_DIR: "github-action-s3-upload"
111+
SOURCE_DIR: "windows-release"
107112

108113
windows-gh-release:
109114
if: ${{ needs.windows-build.outputs.tag != '' }}
@@ -114,12 +119,12 @@ jobs:
114119
uses: actions/download-artifact@v3
115120
with:
116121
name: windows-artifact
117-
path: ./github-action-s3-upload
122+
path: .windows-release/
118123

119124
- name: Release
120125
uses: softprops/action-gh-release@v1
121126
with:
122127
tag_name: ${{ needs.windows-build.outputs.tag }}
123128
draft: true
124129
files: |
125-
github-action-s3-upload/${{ needs.windows-build.outputs.tag }}/*
130+
windows-release/${{ needs.windows-build.outputs.tag }}/*

ci/publish-installer.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ fi
2626
# upload install script
2727
source ci/upload-ci-artifact.sh
2828

29-
cat >release.solana.com-install <<EOF
29+
cat >release.anza.xyz-install <<EOF
3030
SOLANA_RELEASE=$CHANNEL_OR_TAG
3131
SOLANA_INSTALL_INIT_ARGS=$CHANNEL_OR_TAG
32-
SOLANA_DOWNLOAD_ROOT=https://release.solana.com
32+
SOLANA_DOWNLOAD_ROOT=https://release.anza.xyz
3333
EOF
34-
cat install/solana-install-init.sh >>release.solana.com-install
34+
cat install/solana-install-init.sh >>release.anza.xyz-install
3535

36-
echo --- AWS S3 Store: "install"
37-
upload-s3-artifact "/solana/release.solana.com-install" "s3://release.solana.com/$CHANNEL_OR_TAG/install"
36+
echo --- GCS: "install"
37+
upload-gcs-artifact "/solana/release.anza.xyz-install" "gs://anza-release/$CHANNEL_OR_TAG/install"
3838
echo Published to:
39-
ci/format-url.sh https://release.solana.com/"$CHANNEL_OR_TAG"/install
39+
ci/format-url.sh https://release.anza.xyz/"$CHANNEL_OR_TAG"/install

ci/publish-tarball.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ for file in "${TARBALL_BASENAME}"-$TARGET.tar.bz2 "${TARBALL_BASENAME}"-$TARGET.
118118
fi
119119

120120
if [[ -n $BUILDKITE ]]; then
121-
echo --- AWS S3 Store: "$file"
122-
upload-s3-artifact "/solana/$file" s3://release.solana.com/"$CHANNEL_OR_TAG"/"$file"
121+
echo --- GCS Store: "$file"
122+
upload-gcs-artifact "/solana/$file" gs://anza-release/"$CHANNEL_OR_TAG"/"$file"
123123

124124
echo Published to:
125-
$DRYRUN ci/format-url.sh https://release.solana.com/"$CHANNEL_OR_TAG"/"$file"
125+
$DRYRUN ci/format-url.sh https://release.anza.xyz/"$CHANNEL_OR_TAG"/"$file"
126126

127127
if [[ -n $TAG ]]; then
128128
ci/upload-github-release-asset.sh "$file"

ci/upload-ci-artifact.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,13 @@ upload-s3-artifact() {
4040
docker run "${args[@]}"
4141
)
4242
}
43+
44+
upload-gcs-artifact() {
45+
echo "--- artifact: $1 to $2"
46+
docker run --rm \
47+
-v "$GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL:/application_default_credentials.json" \
48+
-v "$PWD:/solana" \
49+
-e CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=/application_default_credentials.json \
50+
gcr.io/google.com/cloudsdktool/google-cloud-cli:latest \
51+
gcloud storage cp "$1" "$2"
52+
}

ci/upload-github-release-asset.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fi
2626
# Force CI_REPO_SLUG since sometimes
2727
# BUILDKITE_TRIGGERED_FROM_BUILD_PIPELINE_SLUG is not set correctly, causing the
2828
# artifact upload to fail
29-
CI_REPO_SLUG=solana-labs/solana
29+
CI_REPO_SLUG=anza-xyz/agave
3030
#if [[ -z $CI_REPO_SLUG ]]; then
3131
# echo Error: CI_REPO_SLUG not defined
3232
# exit 1

install/solana-install-init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
{ # this ensures the entire script is downloaded #
1717

1818
if [ -z "$SOLANA_DOWNLOAD_ROOT" ]; then
19-
SOLANA_DOWNLOAD_ROOT="https://github.com/solana-labs/solana/releases/download/"
19+
SOLANA_DOWNLOAD_ROOT="https://github.com/anza-xyz/agave/releases/download/"
2020
fi
21-
GH_LATEST_RELEASE="https://api.github.com/repos/solana-labs/solana/releases/latest"
21+
GH_LATEST_RELEASE="https://api.github.com/repos/anza-xyz/agave/releases/latest"
2222

2323
set -e
2424

install/src/command.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,23 +573,23 @@ pub fn init(
573573

574574
fn github_release_download_url(release_semver: &str) -> String {
575575
format!(
576-
"https://github.com/solana-labs/solana/releases/download/v{}/solana-release-{}.tar.bz2",
576+
"https://github.com/anza-xyz/agave/releases/download/v{}/solana-release-{}.tar.bz2",
577577
release_semver,
578578
crate::build_env::TARGET
579579
)
580580
}
581581

582582
fn release_channel_download_url(release_channel: &str) -> String {
583583
format!(
584-
"https://release.solana.com/{}/solana-release-{}.tar.bz2",
584+
"https://release.anza.xyz/{}/solana-release-{}.tar.bz2",
585585
release_channel,
586586
crate::build_env::TARGET
587587
)
588588
}
589589

590590
fn release_channel_version_url(release_channel: &str) -> String {
591591
format!(
592-
"https://release.solana.com/{}/solana-release-{}.yml",
592+
"https://release.anza.xyz/{}/solana-release-{}.yml",
593593
release_channel,
594594
crate::build_env::TARGET
595595
)
@@ -906,7 +906,7 @@ fn check_for_newer_github_release(
906906

907907
while page == 1 || releases.len() == PER_PAGE {
908908
let url = reqwest::Url::parse_with_params(
909-
"https://api.github.com/repos/solana-labs/solana/releases",
909+
"https://api.github.com/repos/anza-xyz/agave/releases",
910910
&[
911911
("per_page", &format!("{PER_PAGE}")),
912912
("page", &format!("{page}")),

0 commit comments

Comments
 (0)