github.com/MetalBlockchain/metalgo@v1.11.9/.github/workflows/build-win-release.yml (about) 1 # Build a windows release from the metalgo repo 2 3 name: build-win-release 4 5 # Controls when the action will run. 6 on: 7 workflow_dispatch: 8 inputs: 9 tag: 10 description: 'Tag to include in artifact name' 11 required: true 12 push: 13 tags: 14 - "*" 15 16 # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 jobs: 18 # This workflow contains a single job called "build" 19 build-win: 20 # The type of runner that the job will run on 21 runs-on: windows-2019 22 # Steps represent a sequence of tasks that will be executed as part of the job 23 steps: 24 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 25 - uses: actions/checkout@v4 26 27 - uses: ./.github/actions/setup-go-for-project 28 29 - run: go version 30 31 - name: Install awscli 32 run: | 33 msiexec.exe /passive /i /n https://awscli.amazonaws.com/AWSCLIV2.msi 34 aws --version 35 36 - name: Configure AWS Credentials 37 uses: aws-actions/configure-aws-credentials@v4 38 with: 39 aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} 40 aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 41 aws-region: us-east-1 42 43 - name: Try to get tag from git 44 if: "${{ github.event.inputs.tag == '' }}" 45 id: get_tag_from_git 46 run: | 47 echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV" 48 shell: bash 49 50 - name: Try to get tag from workflow dispatch 51 if: "${{ github.event.inputs.tag != '' }}" 52 id: get_tag_from_workflow 53 run: | 54 echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV" 55 shell: bash 56 57 # Runs a single command using the runners shell 58 - name: Build the metalgo binary 59 run: ./scripts/build.sh 60 shell: bash 61 62 - name: Create zip 63 run: | 64 mv .\build\metalgo .\build\metalgo.exe 65 Compress-Archive -Path .\build\metalgo.exe -DestinationPath .\build\metalgo-win-${{ env.TAG }}-experimental.zip 66 67 - name: Copy to s3 68 run: aws s3 cp .\build\metalgo-win-${{ env.TAG }}-experimental.zip s3://${{ secrets.BUCKET }}/windows/metalgo-win-${{ env.TAG }}-experimental.zip 69 70 - name: Save as Github artifact 71 uses: actions/upload-artifact@v4 72 with: 73 name: build 74 path: .\build\metalgo-win-${{ env.TAG }}-experimental.zip