Skip to content

merged

merged #406

# Build a windows release from the avalanchego repo
name: build-win-release
# Controls when the action will run.
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to include in artifact name'
required: true
push:
tags:
- "*"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-win:
# The type of runner that the job will run on
runs-on: windows-2019
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '~1.20.12'
check-latest: true
- run: go version
- name: Install awscli
run: |
msiexec.exe /passive /i /n https://awscli.amazonaws.com/AWSCLIV2.msi
aws --version
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Try to get tag from git
if: "${{ github.event.inputs.tag == '' }}"
id: get_tag_from_git
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
shell: bash
- name: Try to get tag from workflow dispatch
if: "${{ github.event.inputs.tag != '' }}"
id: get_tag_from_workflow
run: |
echo "TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
shell: bash
# Runs a single command using the runners shell
- name: Build the avalanchego binary
run: ./scripts/build.sh
shell: bash
- name: Create zip
run: |
mv .\build\avalanchego .\build\avalanchego.exe
Compress-Archive -Path .\build\avalanchego.exe -DestinationPath .\build\avalanchego-win-${{ env.TAG }}-experimental.zip
- name: Copy to s3
run: aws s3 cp .\build\avalanchego-win-${{ env.TAG }}-experimental.zip s3://${{ secrets.BUCKET }}/windows/avalanchego-win-${{ env.TAG }}-experimental.zip
- name: Save as Github artifact
uses: actions/upload-artifact@v3
with:
name: build
path: .\build\avalanchego-win-${{ env.TAG }}-experimental.zip