1- name : Publish Windows Tarball
1+ name : release-artifacts
22
33on :
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
1117jobs :
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 }}/*
0 commit comments