Skip to content

Commit 22414c6

Browse files
willhickeywen-coding
authored andcommitted
Revert "[anza migration] replace binaries backend (solana-labs#6)"
This reverts commit 9355518.
1 parent 75c2e5e commit 22414c6

File tree

9 files changed

+112
-78
lines changed

9 files changed

+112
-78
lines changed
Lines changed: 45 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
name: Publish Windows Tarball
1+
name: release-artifacts
22

33
on:
4-
workflow_dispatch:
4+
workflow_call:
55
inputs:
66
commit:
7+
required: false
78
type: string
9+
secrets:
10+
AWS_ACCESS_KEY_ID:
11+
required: true
12+
AWS_SECRET_ACCESS_KEY:
13+
required: true
14+
AWS_S3_BUCKET:
815
required: true
9-
description: commit
1016

1117
jobs:
1218
windows-build:
@@ -16,82 +22,68 @@ jobs:
1622
channel: ${{ steps.build.outputs.channel }}
1723
steps:
1824
- name: Checkout
19-
uses: actions/checkout@v4
25+
uses: actions/checkout@v3
2026
with:
2127
ref: master
2228
fetch-depth: 0
2329

24-
# took the workaround from https://github.com/sfackler/rust-openssl/issues/2149
25-
- name: Set Perl environment variables
30+
- name: Setup Rust
31+
shell: bash
2632
run: |
27-
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
28-
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
33+
source ci/rust-version.sh stable
2934
30-
- name: Build
31-
id: build
35+
# copy the newest version env.sh before switching version.
36+
- name: Copy Env Script
3237
shell: bash
33-
env:
34-
COMMIT: ${{ github.event.inputs.commit }}
3538
run: |
36-
# install all deps
37-
source .github/scripts/install-all-deps.sh ${{ runner.os }}
38-
39-
# checkout the commit
40-
if [[ -z ${{ env.COMMIT }} ]]; then
41-
echo "Required parameter env.COMMIT is empty."
42-
exit 1
43-
fi
39+
cp -r ci/env.sh /tmp/env.sh
4440
45-
git checkout ${{ env.COMMIT }}
41+
- name: Switch Version
42+
if: ${{ inputs.commit }}
43+
run: |
44+
git checkout ${{ inputs.commit }}
4645
47-
source ci/env.sh
46+
- name: Build
47+
id: build
48+
shell: bash
49+
run: |
50+
vcpkg install openssl:x64-windows-static-md
51+
vcpkg integrate install
52+
choco install protoc
53+
export PROTOC="C:\ProgramData\chocolatey\lib\protoc\tools\bin\protoc.exe"
54+
source /tmp/env.sh
4855
echo "tag=$CI_TAG" >> $GITHUB_OUTPUT
4956
eval "$(ci/channel-info.sh)"
5057
echo "channel=$CHANNEL" >> $GITHUB_OUTPUT
51-
52-
# print the info
53-
echo "::notice::commit: ${{ env.COMMIT }}"
54-
echo "::notice::tag: $CI_TAG"
55-
echo "::notice::channel: $CHANNEL"
56-
5758
ci/publish-tarball.sh
5859
5960
- name: Prepare Upload Files
6061
if: ${{ steps.build.outputs.channel != '' || steps.build.outputs.tag != '' }}
6162
shell: bash
6263
run: |
6364
FOLDER_NAME=${{ steps.build.outputs.tag || steps.build.outputs.channel }}
64-
mkdir -p "windows-release/$FOLDER_NAME"
65-
cp -v "solana-release-x86_64-pc-windows-msvc.tar.bz2" "windows-release/$FOLDER_NAME/"
66-
cp -v "solana-release-x86_64-pc-windows-msvc.yml" "windows-release/$FOLDER_NAME/"
67-
cp -v "solana-install-init-x86_64-pc-windows-msvc"* "windows-release/$FOLDER_NAME"
65+
mkdir -p "github-action-s3-upload/$FOLDER_NAME"
66+
cp -v "solana-release-x86_64-pc-windows-msvc.tar.bz2" "github-action-s3-upload/$FOLDER_NAME/"
67+
cp -v "solana-release-x86_64-pc-windows-msvc.yml" "github-action-s3-upload/$FOLDER_NAME/"
68+
cp -v "solana-install-init-x86_64-pc-windows-msvc"* "github-action-s3-upload/$FOLDER_NAME"
6869
6970
- name: Upload Artifacts
7071
if: ${{ steps.build.outputs.channel != '' || steps.build.outputs.tag != '' }}
71-
uses: actions/upload-artifact@v4
72+
uses: actions/upload-artifact@v3
7273
with:
7374
name: windows-artifact
74-
path: windows-release/
75+
path: github-action-s3-upload/
7576

7677
windows-s3-upload:
7778
if: ${{ needs.windows-build.outputs.channel != '' || needs.windows-build.outputs.tag != '' }}
7879
needs: [windows-build]
79-
runs-on: ubuntu-22.04
80+
runs-on: ubuntu-20.04
8081
steps:
8182
- name: Download
82-
uses: actions/download-artifact@v4
83+
uses: actions/download-artifact@v3
8384
with:
8485
name: windows-artifact
85-
path: .windows-release/
86-
87-
- name: Setup crediential
88-
uses: "google-github-actions/auth@v2"
89-
with:
90-
credentials_json: "${{ secrets.GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL }}"
91-
92-
- name: Upload files to GCS
93-
run: |
94-
gcloud storage cp --recursive windows-release/* gs://anza-release/
86+
path: ./github-action-s3-upload
9587

9688
- name: Upload
9789
uses: jakejarvis/s3-sync-action@master
@@ -102,22 +94,23 @@ jobs:
10294
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
10395
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
10496
AWS_REGION: "us-west-1"
105-
SOURCE_DIR: "windows-release"
97+
SOURCE_DIR: "github-action-s3-upload"
10698

10799
windows-gh-release:
108100
if: ${{ needs.windows-build.outputs.tag != '' }}
109101
needs: [windows-build]
110-
runs-on: ubuntu-22.04
102+
runs-on: ubuntu-20.04
111103
steps:
112104
- name: Download
113-
uses: actions/download-artifact@v4
105+
uses: actions/download-artifact@v3
114106
with:
115107
name: windows-artifact
116-
path: ./windows-release/
108+
path: ./github-action-s3-upload
117109

118110
- name: Release
119-
uses: softprops/action-gh-release@v2
111+
uses: softprops/action-gh-release@v1
120112
with:
121113
tag_name: ${{ needs.windows-build.outputs.tag }}
114+
draft: true
122115
files: |
123-
windows-release/${{ needs.windows-build.outputs.tag }}/*
116+
github-action-s3-upload/${{ needs.windows-build.outputs.tag }}/*
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: release-artifacts-auto
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- v[0-9]+.[0-9]+
8+
tags:
9+
- v[0-9]+.[0-9]+.[0-9]+
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
release-artifacts:
17+
if: github.repository == 'solana-labs/solana'
18+
uses: ./.github/workflows/release-artifacts.yml
19+
with:
20+
commit: ${{ github.sha }}
21+
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 }}
25+
26+
error_reporting:
27+
needs:
28+
- release-artifacts
29+
if: failure() && github.event_name == 'push'
30+
uses: ./.github/workflows/error-reporting.yml
31+
secrets:
32+
WEBHOOK: ${{ secrets.SLACK_ERROR_REPORTING_WEBHOOK }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: release-artifacts-manually
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
commit:
7+
type: string
8+
required: true
9+
description: commit
10+
11+
jobs:
12+
release-artifacts:
13+
uses: ./.github/workflows/release-artifacts.yml
14+
with:
15+
commit: ${{ github.event.inputs.commit }}
16+
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 }}

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

36-
echo --- GCS: "install"
37-
upload-gcs-artifact "/solana/release.anza.xyz-install" "gs://anza-release/$CHANNEL_OR_TAG/install"
36+
echo --- AWS S3 Store: "install"
37+
upload-s3-artifact "/solana/release.solana.com-install" "s3://release.solana.com/$CHANNEL_OR_TAG/install"
3838
echo Published to:
39-
ci/format-url.sh https://release.anza.xyz/"$CHANNEL_OR_TAG"/install
39+
ci/format-url.sh https://release.solana.com/"$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 --- GCS Store: "$file"
122-
upload-gcs-artifact "/solana/$file" gs://anza-release/"$CHANNEL_OR_TAG"/"$file"
121+
echo --- AWS S3 Store: "$file"
122+
upload-s3-artifact "/solana/$file" s3://release.solana.com/"$CHANNEL_OR_TAG"/"$file"
123123

124124
echo Published to:
125-
$DRYRUN ci/format-url.sh https://release.anza.xyz/"$CHANNEL_OR_TAG"/"$file"
125+
$DRYRUN ci/format-url.sh https://release.solana.com/"$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: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,3 @@ 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=anza-xyz/agave
29+
CI_REPO_SLUG=solana-labs/solana
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/anza-xyz/agave/releases/download/"
19+
SOLANA_DOWNLOAD_ROOT="https://github.com/solana-labs/solana/releases/download/"
2020
fi
21-
GH_LATEST_RELEASE="https://api.github.com/repos/anza-xyz/agave/releases/latest"
21+
GH_LATEST_RELEASE="https://api.github.com/repos/solana-labs/solana/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
@@ -570,23 +570,23 @@ pub fn init(
570570

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

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

587587
fn release_channel_version_url(release_channel: &str) -> String {
588588
format!(
589-
"https://release.anza.xyz/{}/solana-release-{}.yml",
589+
"https://release.solana.com/{}/solana-release-{}.yml",
590590
release_channel,
591591
crate::build_env::TARGET
592592
)
@@ -903,7 +903,7 @@ fn check_for_newer_github_release(
903903

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

0 commit comments

Comments
 (0)