Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload artifact example #257

Merged
merged 4 commits into from Nov 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 35 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -24,7 +24,7 @@ jobs:
- windows-latest
version:
- latest
- v0.117.0
- v0.145.0
steps:
-
name: Checkout
Expand All @@ -35,7 +35,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.15
-
name: Check
uses: ./
Expand All @@ -56,7 +56,7 @@ jobs:
matrix:
version:
- latest
- v0.117.0
- v0.145.0
steps:
-
name: Checkout
Expand All @@ -67,7 +67,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.15
-
name: GoReleaser
uses: ./
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.15
-
name: Import GPG key
id: import_gpg
Expand All @@ -123,3 +123,33 @@ jobs:
args: -f .goreleaser-signing.yml release --skip-publish --rm-dist
env:
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/*
25 changes: 24 additions & 1 deletion README.md
Expand Up @@ -19,6 +19,7 @@ ___
* [Workflow](#workflow)
* [Run on new tag](#run-on-new-tag)
* [Signing](#signing)
* [Upload artifacts](#upload-artifacts)
* [Install Only](#install-only)
* [Customizing](#customizing)
* [inputs](#inputs)
Expand Down Expand Up @@ -51,7 +52,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.15
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand Down Expand Up @@ -122,6 +123,28 @@ signs:
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

```yaml
Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,3 +1,3 @@
module github.com/goreleaser/goreleaser-action

go 1.14
go 1.15