From 60277f8a8f04eb2dd8accc3ce92a9cd5e77c385e Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sun, 22 Nov 2020 05:44:27 +0100 Subject: [PATCH 1/3] docs: Upload artifact example (#254) --- .github/workflows/ci.yml | 40 +++++++++++++++++++++++++++++++++++----- README.md | 24 +++++++++++++++++++++++- go.mod | 2 +- 3 files changed, 59 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b06064c..8ace5912 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - windows-latest version: - latest - - v0.117.0 + - v0.145.0 steps: - name: Checkout @@ -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: ./ @@ -56,7 +56,7 @@ jobs: matrix: version: - latest - - v0.117.0 + - v0.145.0 steps: - name: Checkout @@ -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: ./ @@ -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 @@ -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/* diff --git a/README.md b/README.md index 7a935821..0caa9e70 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,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 @@ -121,6 +121,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: goreleaser/goreleaser-action@v2 + with: + name: myapp + path: dist/* +``` + ### Install Only ```yaml diff --git a/go.mod b/go.mod index ae06cb69..cc014d31 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/goreleaser/goreleaser-action -go 1.14 +go 1.15 From 70f1c34e92d3f3c449348a2f713c51e2fefe1609 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sun, 22 Nov 2020 05:59:16 +0100 Subject: [PATCH 2/3] Fix README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0caa9e70..c294b0e4 100644 --- a/README.md +++ b/README.md @@ -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) From 0bf20bc67fc93ed293611a8280649e218da33932 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sun, 22 Nov 2020 06:01:47 +0100 Subject: [PATCH 3/3] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c294b0e4..845edd6a 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ purpose. You can do that with the [actions/upload-artifact](https://github.com/a GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload assets - uses: goreleaser/goreleaser-action@v2 + uses: actions/upload-artifact@v2 with: name: myapp path: dist/*