Skip to content

fix(ci): updating CI to not compress release if were not going to upl… #34

fix(ci): updating CI to not compress release if were not going to upl…

fix(ci): updating CI to not compress release if were not going to upl… #34

Workflow file for this run

name: Release Please
on:
workflow_dispatch:
pull_request:
types:
- closed
permissions:
contents: write
pull-requests: write
jobs:
test:
if: |
github.event.pull_request.merged == true &&
github.ref_name == 'master' &&
!contains(github.event.pull_request.head.name, 'release')
uses: ./.github/workflows/test.yaml
release-please:
if: |
github.event.pull_request.merged == true &&
github.ref_name == 'master' &&
!contains(github.event.pull_request.head.name, 'release')
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.18.x"
- name: Build EchoIP binary
run: go build -o ./echoip ./cmd/echoip/main.go
- uses: google-github-actions/release-please-action@v3
id: release
with:
bootstrap-sha: "ef1f4b388c24e977ec63d6943ac8f0b0c5f51b58"
last-release-sha: "32a92399085082121675553e23d722605752519e"
release-type: "go"
command: "release-pr"
- name: Compress Release
if: ${{ steps.release.outputs.releases_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
zip -r echoip-linux-amd64-${{ steps.release.outputs.tag_name }}.zip echoip html LICENSE
- name: Upload Release
if: ${{ steps.release.outputs.releases_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ steps.release.outputs.tag_name }} echoip-linux-amd64-${{ steps.release.outputs.tag_name }}.zip