forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (100 loc) · 3.52 KB
/
release-artifacts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: release-artifacts
on:
workflow_call:
inputs:
commit:
required: false
type: string
secrets:
GCS_RELEASE_BUCKET_WRITER_CREDIENTIAL:
required: true
jobs:
windows-build:
runs-on: windows-2022
outputs:
tag: ${{ steps.build.outputs.tag }}
channel: ${{ steps.build.outputs.channel }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
- name: Setup Rust
shell: bash
run: |
source ci/rust-version.sh stable
# copy the newest version env.sh before switching version.
- name: Copy Env Script
shell: bash
run: |
cp -r ci/env.sh /tmp/env.sh
- name: Switch Version
if: ${{ inputs.commit }}
run: |
git checkout ${{ inputs.commit }}
# took the workaround from https://github.com/sfackler/rust-openssl/issues/2149
- name: Set Perl environment variables
run: |
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Build
id: build
shell: bash
run: |
# install all deps
source .github/scripts/install-all-deps.sh ${{ runner.os }}
source /tmp/env.sh
echo "tag=$CI_TAG" >> $GITHUB_OUTPUT
eval "$(ci/channel-info.sh)"
echo "channel=$CHANNEL" >> $GITHUB_OUTPUT
ci/publish-tarball.sh
- name: Prepare Upload Files
if: ${{ steps.build.outputs.channel != '' || steps.build.outputs.tag != '' }}
shell: bash
run: |
FOLDER_NAME=${{ steps.build.outputs.tag || steps.build.outputs.channel }}
mkdir -p "windows-release/$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" "windows-release/$FOLDER_NAME/"
cp -v "agave-install-init-x86_64-pc-windows-msvc"* "windows-release/$FOLDER_NAME"
- name: Upload Artifacts
if: ${{ steps.build.outputs.channel != '' || steps.build.outputs.tag != '' }}
uses: actions/upload-artifact@v4
with:
name: windows-artifact
path: windows-release/
windows-gcs-upload:
if: ${{ needs.windows-build.outputs.channel != '' || needs.windows-build.outputs.tag != '' }}
needs: [windows-build]
runs-on: ubuntu-20.04
steps:
- name: Download
uses: actions/download-artifact@v4
with:
name: windows-artifact
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/
windows-gh-release:
if: ${{ needs.windows-build.outputs.tag != '' }}
needs: [windows-build]
runs-on: ubuntu-20.04
steps:
- name: Download
uses: actions/download-artifact@v4
with:
name: windows-artifact
path: ./windows-release/
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.windows-build.outputs.tag }}
draft: true
files: |
windows-release/${{ needs.windows-build.outputs.tag }}/*