[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
This commit is contained in:
parent
4b25ab207c
commit
b84d81b7a5
|
@ -14,14 +14,12 @@ concurrency:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release-artifacts:
|
release-artifacts:
|
||||||
if: github.repository == 'solana-labs/solana'
|
if: github.repository == 'anza-xyz/agave'
|
||||||
uses: ./.github/workflows/release-artifacts.yml
|
uses: ./.github/workflows/release-artifacts.yml
|
||||||
with:
|
with:
|
||||||
commit: ${{ github.sha }}
|
commit: ${{ github.sha }}
|
||||||
secrets:
|
secrets:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL: ${{ secrets.GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
|
|
||||||
|
|
||||||
error_reporting:
|
error_reporting:
|
||||||
needs:
|
needs:
|
||||||
|
|
|
@ -14,6 +14,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
commit: ${{ github.event.inputs.commit }}
|
commit: ${{ github.event.inputs.commit }}
|
||||||
secrets:
|
secrets:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL: ${{ secrets.GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
|
|
||||||
|
|
|
@ -7,11 +7,7 @@ on:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
secrets:
|
secrets:
|
||||||
AWS_ACCESS_KEY_ID:
|
GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL:
|
||||||
required: true
|
|
||||||
AWS_SECRET_ACCESS_KEY:
|
|
||||||
required: true
|
|
||||||
AWS_S3_BUCKET:
|
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -71,17 +67,17 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
FOLDER_NAME=${{ steps.build.outputs.tag || steps.build.outputs.channel }}
|
FOLDER_NAME=${{ steps.build.outputs.tag || steps.build.outputs.channel }}
|
||||||
mkdir -p "github-action-s3-upload/$FOLDER_NAME"
|
mkdir -p "windows-release/$FOLDER_NAME"
|
||||||
cp -v "solana-release-x86_64-pc-windows-msvc.tar.bz2" "github-action-s3-upload/$FOLDER_NAME/"
|
cp -v "solana-release-x86_64-pc-windows-msvc.tar.bz2" "windows-release/$FOLDER_NAME/"
|
||||||
cp -v "solana-release-x86_64-pc-windows-msvc.yml" "github-action-s3-upload/$FOLDER_NAME/"
|
cp -v "solana-release-x86_64-pc-windows-msvc.yml" "windows-release/$FOLDER_NAME/"
|
||||||
cp -v "solana-install-init-x86_64-pc-windows-msvc"* "github-action-s3-upload/$FOLDER_NAME"
|
cp -v "solana-install-init-x86_64-pc-windows-msvc"* "windows-release/$FOLDER_NAME"
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
if: ${{ steps.build.outputs.channel != '' || steps.build.outputs.tag != '' }}
|
if: ${{ steps.build.outputs.channel != '' || steps.build.outputs.tag != '' }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: windows-artifact
|
name: windows-artifact
|
||||||
path: github-action-s3-upload/
|
path: windows-release/
|
||||||
|
|
||||||
windows-s3-upload:
|
windows-s3-upload:
|
||||||
if: ${{ needs.windows-build.outputs.channel != '' || needs.windows-build.outputs.tag != '' }}
|
if: ${{ needs.windows-build.outputs.channel != '' || needs.windows-build.outputs.tag != '' }}
|
||||||
|
@ -92,7 +88,16 @@ jobs:
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: windows-artifact
|
name: windows-artifact
|
||||||
path: ./github-action-s3-upload
|
path: .windows-release/
|
||||||
|
|
||||||
|
- name: Setup crediential
|
||||||
|
uses: "google-github-actions/auth@v2"
|
||||||
|
with:
|
||||||
|
credentials_json: "${{ secrets.GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL }}"
|
||||||
|
|
||||||
|
- name: Upload files to GCS
|
||||||
|
run: |
|
||||||
|
gcloud storage cp --recursive windows-release/* gs://anza-release/
|
||||||
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: jakejarvis/s3-sync-action@master
|
uses: jakejarvis/s3-sync-action@master
|
||||||
|
@ -103,7 +108,7 @@ jobs:
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
|
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
|
||||||
AWS_REGION: "us-west-1"
|
AWS_REGION: "us-west-1"
|
||||||
SOURCE_DIR: "github-action-s3-upload"
|
SOURCE_DIR: "windows-release"
|
||||||
|
|
||||||
windows-gh-release:
|
windows-gh-release:
|
||||||
if: ${{ needs.windows-build.outputs.tag != '' }}
|
if: ${{ needs.windows-build.outputs.tag != '' }}
|
||||||
|
@ -114,7 +119,7 @@ jobs:
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: windows-artifact
|
name: windows-artifact
|
||||||
path: ./github-action-s3-upload
|
path: .windows-release/
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
@ -122,4 +127,4 @@ jobs:
|
||||||
tag_name: ${{ needs.windows-build.outputs.tag }}
|
tag_name: ${{ needs.windows-build.outputs.tag }}
|
||||||
draft: true
|
draft: true
|
||||||
files: |
|
files: |
|
||||||
github-action-s3-upload/${{ needs.windows-build.outputs.tag }}/*
|
windows-release/${{ needs.windows-build.outputs.tag }}/*
|
||||||
|
|
|
@ -26,14 +26,14 @@ fi
|
||||||
# upload install script
|
# upload install script
|
||||||
source ci/upload-ci-artifact.sh
|
source ci/upload-ci-artifact.sh
|
||||||
|
|
||||||
cat >release.solana.com-install <<EOF
|
cat >release.anza.xyz-install <<EOF
|
||||||
SOLANA_RELEASE=$CHANNEL_OR_TAG
|
SOLANA_RELEASE=$CHANNEL_OR_TAG
|
||||||
SOLANA_INSTALL_INIT_ARGS=$CHANNEL_OR_TAG
|
SOLANA_INSTALL_INIT_ARGS=$CHANNEL_OR_TAG
|
||||||
SOLANA_DOWNLOAD_ROOT=https://release.solana.com
|
SOLANA_DOWNLOAD_ROOT=https://release.anza.xyz
|
||||||
EOF
|
EOF
|
||||||
cat install/solana-install-init.sh >>release.solana.com-install
|
cat install/solana-install-init.sh >>release.anza.xyz-install
|
||||||
|
|
||||||
echo --- AWS S3 Store: "install"
|
echo --- GCS: "install"
|
||||||
upload-s3-artifact "/solana/release.solana.com-install" "s3://release.solana.com/$CHANNEL_OR_TAG/install"
|
upload-gcs-artifact "/solana/release.anza.xyz-install" "gs://anza-release/$CHANNEL_OR_TAG/install"
|
||||||
echo Published to:
|
echo Published to:
|
||||||
ci/format-url.sh https://release.solana.com/"$CHANNEL_OR_TAG"/install
|
ci/format-url.sh https://release.anza.xyz/"$CHANNEL_OR_TAG"/install
|
||||||
|
|
|
@ -118,11 +118,11 @@ for file in "${TARBALL_BASENAME}"-$TARGET.tar.bz2 "${TARBALL_BASENAME}"-$TARGET.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n $BUILDKITE ]]; then
|
if [[ -n $BUILDKITE ]]; then
|
||||||
echo --- AWS S3 Store: "$file"
|
echo --- GCS Store: "$file"
|
||||||
upload-s3-artifact "/solana/$file" s3://release.solana.com/"$CHANNEL_OR_TAG"/"$file"
|
upload-gcs-artifact "/solana/$file" gs://anza-release/"$CHANNEL_OR_TAG"/"$file"
|
||||||
|
|
||||||
echo Published to:
|
echo Published to:
|
||||||
$DRYRUN ci/format-url.sh https://release.solana.com/"$CHANNEL_OR_TAG"/"$file"
|
$DRYRUN ci/format-url.sh https://release.anza.xyz/"$CHANNEL_OR_TAG"/"$file"
|
||||||
|
|
||||||
if [[ -n $TAG ]]; then
|
if [[ -n $TAG ]]; then
|
||||||
ci/upload-github-release-asset.sh "$file"
|
ci/upload-github-release-asset.sh "$file"
|
||||||
|
|
|
@ -40,3 +40,13 @@ upload-s3-artifact() {
|
||||||
docker run "${args[@]}"
|
docker run "${args[@]}"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
upload-gcs-artifact() {
|
||||||
|
echo "--- artifact: $1 to $2"
|
||||||
|
docker run --rm \
|
||||||
|
-v "$GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL:/application_default_credentials.json" \
|
||||||
|
-v "$PWD:/solana" \
|
||||||
|
-e CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=/application_default_credentials.json \
|
||||||
|
gcr.io/google.com/cloudsdktool/google-cloud-cli:latest \
|
||||||
|
gcloud storage cp "$1" "$2"
|
||||||
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ fi
|
||||||
# Force CI_REPO_SLUG since sometimes
|
# Force CI_REPO_SLUG since sometimes
|
||||||
# BUILDKITE_TRIGGERED_FROM_BUILD_PIPELINE_SLUG is not set correctly, causing the
|
# BUILDKITE_TRIGGERED_FROM_BUILD_PIPELINE_SLUG is not set correctly, causing the
|
||||||
# artifact upload to fail
|
# artifact upload to fail
|
||||||
CI_REPO_SLUG=solana-labs/solana
|
CI_REPO_SLUG=anza-xyz/agave
|
||||||
#if [[ -z $CI_REPO_SLUG ]]; then
|
#if [[ -z $CI_REPO_SLUG ]]; then
|
||||||
# echo Error: CI_REPO_SLUG not defined
|
# echo Error: CI_REPO_SLUG not defined
|
||||||
# exit 1
|
# exit 1
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
{ # this ensures the entire script is downloaded #
|
{ # this ensures the entire script is downloaded #
|
||||||
|
|
||||||
if [ -z "$SOLANA_DOWNLOAD_ROOT" ]; then
|
if [ -z "$SOLANA_DOWNLOAD_ROOT" ]; then
|
||||||
SOLANA_DOWNLOAD_ROOT="https://github.com/solana-labs/solana/releases/download/"
|
SOLANA_DOWNLOAD_ROOT="https://github.com/anza-xyz/agave/releases/download/"
|
||||||
fi
|
fi
|
||||||
GH_LATEST_RELEASE="https://api.github.com/repos/solana-labs/solana/releases/latest"
|
GH_LATEST_RELEASE="https://api.github.com/repos/anza-xyz/agave/releases/latest"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
|
@ -572,7 +572,7 @@ pub fn init(
|
||||||
|
|
||||||
fn github_release_download_url(release_semver: &str) -> String {
|
fn github_release_download_url(release_semver: &str) -> String {
|
||||||
format!(
|
format!(
|
||||||
"https://github.com/solana-labs/solana/releases/download/v{}/solana-release-{}.tar.bz2",
|
"https://github.com/anza-xyz/agave/releases/download/v{}/solana-release-{}.tar.bz2",
|
||||||
release_semver,
|
release_semver,
|
||||||
crate::build_env::TARGET
|
crate::build_env::TARGET
|
||||||
)
|
)
|
||||||
|
@ -580,7 +580,7 @@ fn github_release_download_url(release_semver: &str) -> String {
|
||||||
|
|
||||||
fn release_channel_download_url(release_channel: &str) -> String {
|
fn release_channel_download_url(release_channel: &str) -> String {
|
||||||
format!(
|
format!(
|
||||||
"https://release.solana.com/{}/solana-release-{}.tar.bz2",
|
"https://release.anza.xyz/{}/solana-release-{}.tar.bz2",
|
||||||
release_channel,
|
release_channel,
|
||||||
crate::build_env::TARGET
|
crate::build_env::TARGET
|
||||||
)
|
)
|
||||||
|
@ -588,7 +588,7 @@ fn release_channel_download_url(release_channel: &str) -> String {
|
||||||
|
|
||||||
fn release_channel_version_url(release_channel: &str) -> String {
|
fn release_channel_version_url(release_channel: &str) -> String {
|
||||||
format!(
|
format!(
|
||||||
"https://release.solana.com/{}/solana-release-{}.yml",
|
"https://release.anza.xyz/{}/solana-release-{}.yml",
|
||||||
release_channel,
|
release_channel,
|
||||||
crate::build_env::TARGET
|
crate::build_env::TARGET
|
||||||
)
|
)
|
||||||
|
@ -905,7 +905,7 @@ fn check_for_newer_github_release(
|
||||||
|
|
||||||
while page == 1 || releases.len() == PER_PAGE {
|
while page == 1 || releases.len() == PER_PAGE {
|
||||||
let url = reqwest::Url::parse_with_params(
|
let url = reqwest::Url::parse_with_params(
|
||||||
"https://api.github.com/repos/solana-labs/solana/releases",
|
"https://api.github.com/repos/anza-xyz/agave/releases",
|
||||||
&[
|
&[
|
||||||
("per_page", &format!("{PER_PAGE}")),
|
("per_page", &format!("{PER_PAGE}")),
|
||||||
("page", &format!("{page}")),
|
("page", &format!("{page}")),
|
||||||
|
|
Loading…
Reference in New Issue