github.com/MetalBlockchain/metalgo@v1.11.9/.github/workflows/build-linux-binaries.yml (about)

     1  name: build-linux-release
     2  
     3  on:
     4    workflow_dispatch:
     5      inputs:
     6        tag:
     7          description: 'Tag to include in artifact name'
     8          required: true
     9    push:
    10      tags:
    11        - "*"
    12  
    13  jobs:
    14    build-x86_64-binaries-tarball:
    15      runs-on: ubuntu-20.04
    16  
    17      steps:
    18        - uses: actions/checkout@v4
    19  
    20        - uses: ./.github/actions/setup-go-for-project
    21  
    22        - run: go version
    23  
    24        - name: Build the metalgo binaries
    25          run: ./scripts/build.sh
    26  
    27        - name: Install aws cli
    28          run: |
    29            sudo apt update
    30            sudo apt -y install awscli
    31  
    32        - name: Configure AWS credentials
    33          uses: aws-actions/configure-aws-credentials@v4
    34          with:
    35            aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
    36            aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    37            aws-region: us-east-1
    38  
    39        - name: Try to get tag from git
    40          if: "${{ github.event.inputs.tag == '' }}"
    41          id: get_tag_from_git
    42          run: |
    43            echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
    44          shell: bash
    45  
    46        - name: Try to get tag from workflow dispatch
    47          if: "${{ github.event.inputs.tag != '' }}"
    48          id: get_tag_from_workflow
    49          run: |
    50            echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
    51          shell: bash
    52  
    53        - name: Create tgz package structure and upload to S3
    54          run: ./.github/workflows/build-tgz-pkg.sh
    55          env:
    56            PKG_ROOT: /tmp/metalgo
    57            TAG: ${{ env.TAG }}
    58            BUCKET: ${{ secrets.BUCKET }}
    59            ARCH: "amd64"
    60            RELEASE: "focal"
    61  
    62        - name: Save as Github artifact
    63          uses: actions/upload-artifact@v4
    64          with:
    65            name: amd64
    66            path: /tmp/metalgo/metalgo-linux-amd64-${{ env.TAG }}.tar.gz
    67  
    68        - name: Cleanup
    69          run: |
    70            rm -rf ./build
    71            rm -rf /tmp/metalgo
    72  
    73    build-arm64-binaries-tarball:
    74      runs-on: custom-arm64-focal
    75  
    76      steps:
    77        - uses: actions/checkout@v4
    78  
    79        - uses: ./.github/actions/install-focal-deps
    80  
    81        - uses: ./.github/actions/setup-go-for-project-v3
    82  
    83        - run: go version
    84  
    85        - name: Build the metalgo binaries
    86          run: ./scripts/build.sh
    87  
    88        - name: Install aws cli
    89          run: |
    90            sudo apt update
    91            sudo apt -y install awscli
    92  
    93        - name: Configure AWS credentials
    94          uses: aws-actions/configure-aws-credentials@v4
    95          with:
    96            aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
    97            aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    98            aws-region: us-east-1
    99  
   100        - name: Try to get tag from git
   101          if: "${{ github.event.inputs.tag == '' }}"
   102          id: get_tag_from_git
   103          run: |
   104            echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV"
   105          shell: bash
   106  
   107        - name: Try to get tag from workflow dispatch
   108          if: "${{ github.event.inputs.tag != '' }}"
   109          id: get_tag_from_workflow
   110          run: |
   111            echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV"
   112          shell: bash
   113  
   114        - name: Create tgz package structure and upload to S3
   115          run: ./.github/workflows/build-tgz-pkg.sh
   116          env:
   117            PKG_ROOT: /tmp/metalgo
   118            TAG: ${{ env.TAG }}
   119            BUCKET: ${{ secrets.BUCKET }}
   120            ARCH: "arm64"
   121            RELEASE: "focal"
   122  
   123        - name: Save as Github artifact
   124          uses: actions/upload-artifact@v4
   125          with:
   126            name: arm64
   127            path: /tmp/metalgo/metalgo-linux-arm64-${{ env.TAG }}.tar.gz
   128  
   129        - name: Cleanup
   130          run: |
   131            rm -rf ./build
   132            rm -rf /tmp/metalgo