-
Notifications
You must be signed in to change notification settings - Fork 680
78 lines (64 loc) · 2.42 KB
/
build-win-release.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
# 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
permissions:
id-token: write
contents: read
# 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@v4
- uses: ./.github/actions/setup-go-for-project
- 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@v4
with:
role-to-assume: ${{ secrets.AWS_DEPLOY_SA_ROLE_ARN }}
role-session-name: githubrolesession
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@v4
with:
name: build
path: .\build\avalanchego-win-${{ env.TAG }}-experimental.zip