Upload artifact example (#257)

* docs: Upload artifact example (#254)

* Fix README

* Typo

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-11-30 00:57:19 +01:00 committed by GitHub
parent a61bc075fd
commit 50de962f84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 7 deletions

View File

@ -24,7 +24,7 @@ jobs:
- windows-latest - windows-latest
version: version:
- latest - latest
- v0.117.0 - v0.145.0
steps: steps:
- -
name: Checkout name: Checkout
@ -35,7 +35,7 @@ jobs:
name: Set up Go name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.14 go-version: 1.15
- -
name: Check name: Check
uses: ./ uses: ./
@ -56,7 +56,7 @@ jobs:
matrix: matrix:
version: version:
- latest - latest
- v0.117.0 - v0.145.0
steps: steps:
- -
name: Checkout name: Checkout
@ -67,7 +67,7 @@ jobs:
name: Set up Go name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.14 go-version: 1.15
- -
name: GoReleaser name: GoReleaser
uses: ./ uses: ./
@ -99,7 +99,7 @@ jobs:
name: Set up Go name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.14 go-version: 1.15
- -
name: Import GPG key name: Import GPG key
id: import_gpg id: import_gpg
@ -123,3 +123,33 @@ jobs:
args: -f .goreleaser-signing.yml release --skip-publish --rm-dist args: -f .goreleaser-signing.yml release --skip-publish --rm-dist
env: env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
upload-artifact:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Check
uses: ./
with:
args: check --debug
-
name: GoReleaser
uses: ./
with:
args: release --skip-publish --rm-dist
-
name: Upload assets
uses: actions/upload-artifact@v2
with:
name: myapp
path: dist/*

View File

@ -19,6 +19,7 @@ ___
* [Workflow](#workflow) * [Workflow](#workflow)
* [Run on new tag](#run-on-new-tag) * [Run on new tag](#run-on-new-tag)
* [Signing](#signing) * [Signing](#signing)
* [Upload artifacts](#upload-artifacts)
* [Install Only](#install-only) * [Install Only](#install-only)
* [Customizing](#customizing) * [Customizing](#customizing)
* [inputs](#inputs) * [inputs](#inputs)
@ -51,7 +52,7 @@ jobs:
name: Set up Go name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.14 go-version: 1.15
- -
name: Run GoReleaser name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2 uses: goreleaser/goreleaser-action@v2
@ -122,6 +123,28 @@ signs:
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"] args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
``` ```
### Upload artifacts
For some events like pull request or schedule you might want to store the artifacts somewhere for testing
purpose. You can do that with the [actions/upload-artifact](https://github.com/actions/upload-artifact) action:
```yaml
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Upload assets
uses: actions/upload-artifact@v2
with:
name: myapp
path: dist/*
```
### Install Only ### Install Only
```yaml ```yaml

2
go.mod
View File

@ -1,3 +1,3 @@
module github.com/goreleaser/goreleaser-action module github.com/goreleaser/goreleaser-action
go 1.14 go 1.15