forgejo-runner-act/.github/workflows/push.yml
Justin Grote da07324779
CI: Add snapshot artifacts to PR builds (#574)
* Feat: Add snapshot artifacts to PR builds

* Separate Artifacts to keep file size down

* Name the tasks
2021-03-28 21:38:28 -07:00

80 lines
1.8 KiB
YAML

name: push
on: [push, pull_request]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: golangci/golangci-lint-action@v2
env:
CGO_ENABLED: 0
with:
version: v1.32.2
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- uses: actions/setup-go@v1
with:
go-version: 1.14
- run: go test -cover ./...
env:
CGO_ENABLED: 0
snapshot:
name: Snapshot
if: ${{ github.event_name == 'pull_request' }}
needs:
- lint
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --snapshot --rm-dist
- name: Capture Linux Binary
uses: actions/upload-artifact@v2
with:
name: act-linux
path: dist/act_linux_amd64/act
- name: Capture Windows Binary
uses: actions/upload-artifact@v2
with:
name: act-windows
path: dist/act_windows_amd64/act.exe
- name: Capture MacOS Binary
uses: actions/upload-artifact@v2
with:
name: act-macos
path: dist/act_darwin_amd64/act
release:
name: Release
if: startsWith(github.ref, 'refs/tags/v')
needs:
- lint
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
- name: Chocolatey
uses: ./.github/actions/choco
with:
version: ${{ github.ref }}
apiKey: ${{ secrets.CHOCO_APIKEY }}