github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/.github/workflows/release.yml (about) 1 name: Release 2 3 on: 4 push: 5 tags: 6 - "v[0-9]+.[0-9]+.[0-9]+" 7 8 jobs: 9 release_job: 10 name: Release 11 runs-on: ${{ matrix.os }} 12 strategy: 13 matrix: 14 include: 15 - os: ubuntu-latest 16 artifact_name: pub_client-linux-amd64 17 applet_mgr_name: srv-applet-mgr-linux-amd64 18 - os: windows-latest 19 artifact_name: pub_client-windows-amd64.exe 20 applet_mgr_name: srv-applet-mgr-windows-amd64 21 - os: macos-latest 22 artifact_name: pub_client-darwin-amd64 23 applet_mgr_name: srv-applet-mgr-darwin-amd64 24 25 steps: 26 - name: Checkout code 27 uses: actions/checkout@v2 28 with: 29 ref: ${{ github.event.pull_request.head.sha }} 30 fetch-depth: 0 31 32 - name: Set up Go 33 uses: actions/setup-go@v2 34 with: 35 go-version: 1.21 36 37 - name: make pub_client 38 run: | 39 set CGO_ENABLED=1 40 set GOARCH=amd64 41 go build -o ./${{ matrix.applet_mgr_name }} -v ./cmd/srv-applet-mgr 42 go build -o ./${{ matrix.artifact_name }} -v ./cmd/pub_client 43 44 - name: Upload srv-applet-mgr binaries to release 45 uses: svenstaro/upload-release-action@v2 46 with: 47 repo_token: ${{ secrets.GITHUB_TOKEN }} 48 file: ./${{ matrix.applet_mgr_name }} 49 asset_name: ${{ matrix.applet_mgr_name }} 50 tag: ${{ github.ref }} 51 52 - name: Upload pub_client binaries to release 53 uses: svenstaro/upload-release-action@v2 54 with: 55 repo_token: ${{ secrets.GITHUB_TOKEN }} 56 file: ./${{ matrix.artifact_name }} 57 asset_name: ${{ matrix.artifact_name }} 58 tag: ${{ github.ref }} 59 60 - name: Configure srv-applet-mgr GPG Linux/MacOS 61 if: startsWith(matrix.os, 'windows-latest') != true 62 env: 63 GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} 64 GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} 65 run: | 66 export GPG_TTY=$(tty) 67 echo "$GPG_SIGNING_KEY" | gpg --batch --import 68 echo "$GPG_PASSPHRASE" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch -ab ./${{ matrix.applet_mgr_name }} 69 70 - name: Configure srv-applet-mgr GPG Windows 71 if: startsWith(matrix.os, 'windows-latest') 72 env: 73 GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} 74 GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} 75 run: | 76 echo $env:GPG_SIGNING_KEY | gpg --batch --import 77 gpg --passphrase "$env:GPG_PASSPHRASE" --batch --pinentry-mode loopback -ab ./${{ matrix.applet_mgr_name }} 78 79 - name: Upload srv-applet-mgr signature 80 uses: svenstaro/upload-release-action@v2 81 with: 82 repo_token: ${{ secrets.GITHUB_TOKEN }} 83 asset_name: ${{ matrix.applet_mgr_name }}.asc 84 file: ./${{ matrix.applet_mgr_name }}.asc 85 tag: ${{ github.ref }} 86 87 - name: Configure pub_client GPG Linux/MacOS 88 if: startsWith(matrix.os, 'windows-latest') != true 89 env: 90 GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} 91 GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} 92 run: | 93 export GPG_TTY=$(tty) 94 echo "$GPG_SIGNING_KEY" | gpg --batch --import 95 echo "$GPG_PASSPHRASE" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch -ab ./${{ matrix.artifact_name }} 96 97 - name: Configure pub_client GPG Windows 98 if: startsWith(matrix.os, 'windows-latest') 99 env: 100 GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} 101 GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} 102 run: | 103 echo $env:GPG_SIGNING_KEY | gpg --batch --import 104 gpg --passphrase "$env:GPG_PASSPHRASE" --batch --pinentry-mode loopback -ab ./${{ matrix.artifact_name }} 105 106 - name: Upload pub_client signature 107 uses: svenstaro/upload-release-action@v2 108 with: 109 repo_token: ${{ secrets.GITHUB_TOKEN }} 110 asset_name: ${{ matrix.artifact_name }}.asc 111 file: ./${{ matrix.artifact_name }}.asc 112 tag: ${{ github.ref }}