2022-05-03 08:20:23 -07:00
|
|
|
name: release-artifacts
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
2022-05-13 02:10:03 -07:00
|
|
|
commit:
|
2022-05-03 08:20:23 -07:00
|
|
|
required: false
|
|
|
|
type: string
|
2022-05-03 20:48:17 -07:00
|
|
|
secrets:
|
|
|
|
AWS_ACCESS_KEY_ID:
|
|
|
|
required: true
|
|
|
|
AWS_SECRET_ACCESS_KEY:
|
|
|
|
required: true
|
|
|
|
AWS_S3_BUCKET:
|
|
|
|
required: true
|
2022-05-03 08:20:23 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
windows-build:
|
|
|
|
runs-on: windows-2022
|
2022-05-13 02:10:03 -07:00
|
|
|
outputs:
|
|
|
|
tag: ${{ steps.build.outputs.tag }}
|
|
|
|
channel: ${{ steps.build.outputs.channel }}
|
2022-05-03 08:20:23 -07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
2022-05-13 02:10:03 -07:00
|
|
|
ref: master
|
2022-05-03 08:20:23 -07:00
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Setup Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: 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
|
2022-05-13 02:10:03 -07:00
|
|
|
if: ${{ inputs.commit }}
|
2022-05-03 08:20:23 -07:00
|
|
|
run: |
|
2022-05-13 02:10:03 -07:00
|
|
|
git checkout ${{ inputs.commit }}
|
2022-05-03 08:20:23 -07:00
|
|
|
|
|
|
|
- name: Build
|
2022-05-13 02:10:03 -07:00
|
|
|
id: build
|
2022-05-03 08:20:23 -07:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
choco install openssl
|
|
|
|
export OPENSSL_DIR="C:\Program Files\OpenSSL-Win64"
|
|
|
|
choco install protoc
|
2022-08-08 08:42:12 -07:00
|
|
|
export PROTOC="C:\ProgramData\chocolatey\lib\protoc\tools\bin\protoc.exe"
|
2022-05-03 08:20:23 -07:00
|
|
|
source /tmp/env.sh
|
2022-05-13 02:10:03 -07:00
|
|
|
echo "::set-output name=tag::$CI_TAG"
|
|
|
|
eval "$(ci/channel-info.sh)"
|
|
|
|
echo "::set-output name=channel::$CHANNEL"
|
2022-05-03 08:20:23 -07:00
|
|
|
ci/publish-tarball.sh
|
2022-05-13 02:10:03 -07:00
|
|
|
|
|
|
|
- name: Prepare Upload Files
|
|
|
|
if: ${{ steps.build.outputs.channel != '' || steps.build.outputs.tag != '' }}
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-05-18 09:41:33 -07:00
|
|
|
FOLDER_NAME=${{ steps.build.outputs.tag || steps.build.outputs.channel }}
|
|
|
|
mkdir -p "github-action-s3-upload/$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.yml" "github-action-s3-upload/$FOLDER_NAME/"
|
|
|
|
cp -v "solana-install-init-x86_64-pc-windows-msvc"* "github-action-s3-upload/$FOLDER_NAME"
|
2022-05-03 08:20:23 -07:00
|
|
|
|
|
|
|
- name: Upload Artifacts
|
2022-05-13 02:10:03 -07:00
|
|
|
if: ${{ steps.build.outputs.channel != '' || steps.build.outputs.tag != '' }}
|
2022-05-03 08:20:23 -07:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: windows-artifact
|
|
|
|
path: github-action-s3-upload/
|
|
|
|
|
|
|
|
windows-s3-upload:
|
2022-05-13 02:10:03 -07:00
|
|
|
if: ${{ needs.windows-build.outputs.channel != '' || needs.windows-build.outputs.tag != '' }}
|
2022-05-03 08:20:23 -07:00
|
|
|
needs: [windows-build]
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Download
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: windows-artifact
|
|
|
|
path: ./github-action-s3-upload
|
|
|
|
|
|
|
|
- name: Upload
|
|
|
|
uses: jakejarvis/s3-sync-action@master
|
|
|
|
with:
|
2022-05-03 09:44:35 -07:00
|
|
|
args: --acl public-read --follow-symlinks
|
2022-05-03 08:20:23 -07:00
|
|
|
env:
|
2022-05-03 20:48:17 -07:00
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
2022-05-03 08:20:23 -07:00
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
|
|
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
|
|
|
|
AWS_REGION: "us-west-1"
|
|
|
|
SOURCE_DIR: "github-action-s3-upload"
|
2022-05-04 01:20:36 -07:00
|
|
|
|
|
|
|
windows-gh-release:
|
2022-05-13 02:10:03 -07:00
|
|
|
if: ${{ needs.windows-build.outputs.tag != '' }}
|
2022-05-04 01:20:36 -07:00
|
|
|
needs: [windows-build]
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Download
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: windows-artifact
|
|
|
|
path: ./github-action-s3-upload
|
|
|
|
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2022-05-18 09:41:33 -07:00
|
|
|
tag_name: ${{ needs.windows-build.outputs.tag }}
|
2022-05-04 01:20:36 -07:00
|
|
|
draft: true
|
|
|
|
files: |
|
2022-05-18 09:41:33 -07:00
|
|
|
github-action-s3-upload/${{ needs.windows-build.outputs.tag }}/*
|