Skip to content

fix(ci): create a release when the release PR is merged #31

fix(ci): create a release when the release PR is merged

fix(ci): create a release when the release PR is merged #31

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-please
with:
bootstrap-sha: "ef1f4b388c24e977ec63d6943ac8f0b0c5f51b58"
last-release-sha: "32a92399085082121675553e23d722605752519e"
release-type: "go"
command: "release-pr"
- name: Compress Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
zip -r echoip-linux-amd64-${{ steps.release.outputs.tag_name }}.zip echoip html LICENSE
- name: Upload Releas
if: ${{ steps.release-please.outputs.release_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