github.com/MetalBlockchain/metalgo@v1.11.9/.github/workflows/build-ubuntu-amd64-release.yml (about) 1 name: build-amd64-debian-packages 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-jammy-amd64-package: 15 runs-on: ubuntu-22.04 16 17 steps: 18 - uses: actions/checkout@v4 19 - uses: ./.github/actions/setup-go-for-project 20 - run: go version 21 22 - name: Build the metalgo binaries 23 run: ./scripts/build.sh 24 25 - name: Install aws cli 26 run: | 27 sudo apt update 28 sudo apt -y install awscli 29 30 - name: Configure AWS credentials 31 uses: aws-actions/configure-aws-credentials@v4 32 with: 33 aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} 34 aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 35 aws-region: us-east-1 36 37 - name: Try to get tag from git 38 if: "${{ github.event.inputs.tag == '' }}" 39 id: get_tag_from_git 40 run: | 41 echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV" 42 shell: bash 43 44 - name: Try to get tag from workflow dispatch 45 if: "${{ github.event.inputs.tag != '' }}" 46 id: get_tag_from_workflow 47 run: | 48 echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV" 49 shell: bash 50 51 - name: Create debian package 52 run: ./.github/workflows/build-deb-pkg.sh 53 env: 54 PKG_ROOT: /tmp/metalgo 55 TAG: ${{ env.TAG }} 56 BUCKET: ${{ secrets.BUCKET }} 57 ARCH: "amd64" 58 RELEASE: "jammy" 59 60 - name: Save as Github artifact 61 uses: actions/upload-artifact@v4 62 with: 63 name: jammy 64 path: /tmp/metalgo/metalgo-${{ env.TAG }}-amd64.deb 65 66 - name: Cleanup 67 run: | 68 rm -rf ./build 69 rm -rf /tmp/metalgo 70 71 build-focal-amd64-package: 72 runs-on: ubuntu-20.04 73 74 steps: 75 - uses: actions/checkout@v4 76 - uses: ./.github/actions/setup-go-for-project 77 - run: go version 78 79 - name: Build the metalgo binaries 80 run: ./scripts/build.sh 81 82 - name: Install aws cli 83 run: | 84 sudo apt update 85 sudo apt -y install awscli 86 87 - name: Try to get tag from git 88 if: "${{ github.event.inputs.tag == '' }}" 89 id: get_tag_from_git 90 run: | 91 echo "TAG=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV" 92 shell: bash 93 94 - name: Try to get tag from workflow dispatch 95 if: "${{ github.event.inputs.tag != '' }}" 96 id: get_tag_from_workflow 97 run: | 98 echo "TAG=${{ github.event.inputs.tag }}" >> "$GITHUB_ENV" 99 shell: bash 100 101 - name: Configure AWS credentials 102 uses: aws-actions/configure-aws-credentials@v4 103 with: 104 aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} 105 aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 106 aws-region: us-east-1 107 108 - name: Create debian package 109 run: ./.github/workflows/build-deb-pkg.sh 110 env: 111 PKG_ROOT: /tmp/metalgo 112 TAG: ${{ env.TAG }} 113 BUCKET: ${{ secrets.BUCKET }} 114 ARCH: "amd64" 115 RELEASE: "focal" 116 117 - name: Save as Github artifact 118 uses: actions/upload-artifact@v4 119 with: 120 name: focal 121 path: /tmp/metalgo/metalgo-${{ env.TAG }}-amd64.deb 122 123 - name: Cleanup 124 run: | 125 rm -rf ./build 126 rm -rf /tmp/metalgo