mirror of
https://github.com/actions/go-versions
synced 2024-11-24 20:22:40 +00:00
Merge pull request #18 from MaksimZhukov/v-mazhuk/add-pull-request-event-trigger
Add ability to trigger packages generation on PRs
This commit is contained in:
commit
e89bc70e56
1 changed files with 14 additions and 7 deletions
21
.github/workflows/build-go-packages.yml
vendored
21
.github/workflows/build-go-packages.yml
vendored
|
@ -10,19 +10,26 @@ on:
|
||||||
description: 'Whether to publish releases'
|
description: 'Whether to publish releases'
|
||||||
required: true
|
required: true
|
||||||
default: 'false'
|
default: 'false'
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- 'versions-manifest.json'
|
||||||
|
- 'LICENSE'
|
||||||
|
- '**.md'
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ github.event.inputs.VERSION }}
|
VERSION: ${{ github.event.inputs.VERSION || '1.15.3' }}
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_go:
|
build_go:
|
||||||
name: Build Go ${{ github.event.inputs.VERSION }} [${{ matrix.platform }}]
|
name: Build Go ${{ github.event.inputs.VERSION || '1.15.3' }} [${{ matrix.platform }}]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
ARTIFACT_NAME: go-${{ github.event.inputs.VERSION }}-${{ matrix.platform }}-x64
|
ARTIFACT_NAME: go-${{ github.event.inputs.VERSION || '1.15.3' }}-${{ matrix.platform }}-x64
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -44,11 +51,11 @@ jobs:
|
||||||
path: ${{ runner.temp }}/artifact
|
path: ${{ runner.temp }}/artifact
|
||||||
|
|
||||||
test_go:
|
test_go:
|
||||||
name: Test Go ${{ github.event.inputs.VERSION }} [${{ matrix.platform }}]
|
name: Test Go ${{ github.event.inputs.VERSION || '1.15.3' }} [${{ matrix.platform }}]
|
||||||
needs: build_go
|
needs: build_go
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
ARTIFACT_NAME: go-${{ github.event.inputs.VERSION }}-${{ matrix.platform }}-x64
|
ARTIFACT_NAME: go-${{ github.event.inputs.VERSION || '1.15.3' }}-${{ matrix.platform }}-x64
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -89,7 +96,7 @@ jobs:
|
||||||
working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
|
working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
|
||||||
|
|
||||||
- name: Setup Go ${{ env.VERSION }}
|
- name: Setup Go ${{ env.VERSION }}
|
||||||
uses: actions/setup-go@v2.1.1
|
uses: actions/setup-go@v2.1.3
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.VERSION }}
|
go-version: ${{ env.VERSION }}
|
||||||
|
|
||||||
|
@ -110,7 +117,7 @@ jobs:
|
||||||
|
|
||||||
publish_release:
|
publish_release:
|
||||||
name: Publish release
|
name: Publish release
|
||||||
if: github.event.inputs.PUBLISH_RELEASES == 'true'
|
if: github.event_name == 'workflow_dispatch' && github.event.inputs.PUBLISH_RELEASES == 'true'
|
||||||
needs: test_go
|
needs: test_go
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
Loading…
Reference in a new issue