mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-08-29 06:58:30 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e37040623 | ||
|
|
a1f27b29e7 |
@@ -1 +0,0 @@
|
|||||||
node_modules
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
time: "06:00"
|
|
||||||
timezone: "Europe/Paris"
|
|
||||||
labels:
|
|
||||||
- "dependencies"
|
|
||||||
- package-ecosystem: "npm"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
time: "06:00"
|
|
||||||
timezone: "Europe/Paris"
|
|
||||||
allow:
|
|
||||||
- dependency-type: "production"
|
|
||||||
labels:
|
|
||||||
- "dependencies"
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- feature/*
|
||||||
|
- releases/*
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- feature/*
|
||||||
|
- releases/*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macOS-latest
|
||||||
|
- windows-latest
|
||||||
|
version:
|
||||||
|
- latest
|
||||||
|
- v0.117.0
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
-
|
||||||
|
name: Unshallow
|
||||||
|
run: git fetch --prune --unshallow
|
||||||
|
-
|
||||||
|
name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.13
|
||||||
|
-
|
||||||
|
name: Check
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
args: check --debug
|
||||||
|
-
|
||||||
|
name: GoReleaser
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
args: release --skip-publish --rm-dist
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 10 * * *' # everyday at 10am
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- releases/v*
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- releases/v*
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
ci:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- ubuntu-latest
|
|
||||||
- macOS-latest
|
|
||||||
- windows-latest
|
|
||||||
version:
|
|
||||||
- latest
|
|
||||||
- v0.145.0
|
|
||||||
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:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
args: check --debug
|
|
||||||
-
|
|
||||||
name: GoReleaser
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
args: release --skip-publish --rm-dist
|
|
||||||
|
|
||||||
install-only:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
version:
|
|
||||||
- latest
|
|
||||||
- v0.145.0
|
|
||||||
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: GoReleaser
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
version: ${{ matrix.version }}
|
|
||||||
install-only: true
|
|
||||||
-
|
|
||||||
name: Check
|
|
||||||
run: |
|
|
||||||
goreleaser check --debug
|
|
||||||
|
|
||||||
signing:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- ubuntu-latest
|
|
||||||
- macOS-latest
|
|
||||||
- windows-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: Import GPG key
|
|
||||||
id: import_gpg
|
|
||||||
uses: crazy-max/ghaction-import-gpg@v3
|
|
||||||
with:
|
|
||||||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY_TEST }}
|
|
||||||
passphrase: ${{ secrets.PASSPHRASE_TEST }}
|
|
||||||
-
|
|
||||||
name: Check
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
args: -f .goreleaser-signing.yml check --debug
|
|
||||||
env:
|
|
||||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
|
||||||
-
|
|
||||||
name: GoReleaser
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
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/*
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
name: lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/lint.yml'
|
||||||
|
- 'src/*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
# https://github.com/actions/checkout
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
-
|
||||||
|
# https://github.com/actions/setup-node
|
||||||
|
name: Set up Node
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
-
|
||||||
|
name: Setup TS
|
||||||
|
run: npm install tslint typescript -g
|
||||||
|
-
|
||||||
|
name: Lint check
|
||||||
|
run: tslint './src/*.ts'
|
||||||
+14
-25
@@ -1,32 +1,18 @@
|
|||||||
name: test
|
name: test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- feature/*
|
||||||
|
- releases/*
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- releases/v*
|
- feature/*
|
||||||
paths-ignore:
|
- releases/*
|
||||||
- '**.md'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-containerized:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
-
|
|
||||||
name: Validate
|
|
||||||
run: docker buildx bake validate
|
|
||||||
-
|
|
||||||
name: Test
|
|
||||||
run: docker buildx bake test
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
@@ -38,17 +24,20 @@ jobs:
|
|||||||
- windows-latest
|
- windows-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
|
# https://github.com/actions/checkout
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
-
|
||||||
fetch-depth: 0
|
name: Unshallow
|
||||||
|
run: git fetch --prune --unshallow
|
||||||
-
|
-
|
||||||
name: Install
|
name: Install
|
||||||
run: yarn install
|
run: npm install
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
run: yarn run test
|
run: npm run test
|
||||||
-
|
-
|
||||||
|
# https://github.com/codecov/codecov-action
|
||||||
name: Upload coverage
|
name: Upload coverage
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
if: success()
|
if: success()
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
env:
|
|
||||||
- GO111MODULE=on
|
|
||||||
- GOPROXY=https://goproxy.io
|
|
||||||
|
|
||||||
before:
|
|
||||||
hooks:
|
|
||||||
- go mod download
|
|
||||||
|
|
||||||
builds:
|
|
||||||
-
|
|
||||||
env:
|
|
||||||
- CGO_ENABLED=0
|
|
||||||
goos:
|
|
||||||
- darwin
|
|
||||||
- linux
|
|
||||||
- windows
|
|
||||||
goarch:
|
|
||||||
- 386
|
|
||||||
- amd64
|
|
||||||
|
|
||||||
archives:
|
|
||||||
-
|
|
||||||
replacements:
|
|
||||||
386: i386
|
|
||||||
amd64: x86_64
|
|
||||||
format_overrides:
|
|
||||||
- goos: windows
|
|
||||||
format: zip
|
|
||||||
files:
|
|
||||||
- LICENSE
|
|
||||||
- README.md
|
|
||||||
- CHANGELOG.md
|
|
||||||
|
|
||||||
checksum:
|
|
||||||
name_template: 'checksums.txt'
|
|
||||||
|
|
||||||
signs:
|
|
||||||
-
|
|
||||||
artifacts: checksum
|
|
||||||
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
env:
|
|
||||||
- GO111MODULE=on
|
|
||||||
- GOPROXY=https://goproxy.io
|
|
||||||
|
|
||||||
before:
|
|
||||||
hooks:
|
|
||||||
- go mod download
|
|
||||||
|
|
||||||
builds:
|
|
||||||
-
|
|
||||||
env:
|
|
||||||
- CGO_ENABLED=0
|
|
||||||
goos:
|
|
||||||
- darwin
|
|
||||||
- linux
|
|
||||||
- windows
|
|
||||||
goarch:
|
|
||||||
- 386
|
|
||||||
- amd64
|
|
||||||
|
|
||||||
archives:
|
|
||||||
-
|
|
||||||
replacements:
|
|
||||||
386: i386
|
|
||||||
amd64: x86_64
|
|
||||||
format_overrides:
|
|
||||||
- goos: windows
|
|
||||||
format: zip
|
|
||||||
files:
|
|
||||||
- LICENSE
|
|
||||||
- README.md
|
|
||||||
- CHANGELOG.md
|
|
||||||
|
|
||||||
checksum:
|
|
||||||
name_template: 'checksums.txt'
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
version = 1
|
|
||||||
|
|
||||||
[merge]
|
|
||||||
automerge_label = "automerge"
|
|
||||||
blacklist_title_regex = "^WIP.*"
|
|
||||||
method = "squash"
|
|
||||||
delete_branch_on_merge = true
|
|
||||||
block_on_reviews_requested = false
|
|
||||||
notify_on_conflict = true
|
|
||||||
optimistic_updates = true
|
|
||||||
|
|
||||||
[merge.message]
|
|
||||||
title = "pull_request_title"
|
|
||||||
include_pr_number = true
|
|
||||||
body_type = "markdown"
|
|
||||||
@@ -1,50 +1,5 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 2.4.0 (2020/11/30)
|
|
||||||
|
|
||||||
* Set GORELEASER_CURRENT_TAG (#259)
|
|
||||||
* Container based developer flow (#258)
|
|
||||||
* Upload artifact example (#257)
|
|
||||||
* Bump @actions/tool-cache from 1.6.0 to 1.6.1 (#256)
|
|
||||||
|
|
||||||
## 2.3.0 (2020/11/06)
|
|
||||||
|
|
||||||
* Add install-only option for using goreleaser in user scripts (#252)
|
|
||||||
* Update deps
|
|
||||||
|
|
||||||
## 2.2.1 (2020/10/01)
|
|
||||||
|
|
||||||
* Fix CVE-2020-15228
|
|
||||||
|
|
||||||
## 2.2.0 (2020/08/27)
|
|
||||||
|
|
||||||
* Use GITHUB_REF to retrieve tag before checking the most recent tag (#238)
|
|
||||||
* Update deps
|
|
||||||
|
|
||||||
## 2.1.1 (2020/06/24)
|
|
||||||
|
|
||||||
* Fix workdir (#224)
|
|
||||||
|
|
||||||
## 2.1.0 (2020/06/15)
|
|
||||||
|
|
||||||
* Implement (optional) semver parsing of version (#213)
|
|
||||||
* Remove unshallow step (goreleaser/goreleaser#1608)
|
|
||||||
|
|
||||||
## 2.0.2 (2020/05/10)
|
|
||||||
|
|
||||||
* Use template in `sign.args`
|
|
||||||
|
|
||||||
## 2.0.1 (2020/05/10)
|
|
||||||
|
|
||||||
* Dummy release to mark v2 as latest on the marketplace
|
|
||||||
|
|
||||||
## 2.0.0 (2020/05/10)
|
|
||||||
|
|
||||||
* Remove `key` input and use [Import GPG](https://github.com/crazy-max/ghaction-import-gpg) GitHub Action instead.
|
|
||||||
* Make `args` input as required
|
|
||||||
* Go 1.14
|
|
||||||
* Update deps
|
|
||||||
|
|
||||||
## 1.5.1 (2020/05/10)
|
## 1.5.1 (2020/05/10)
|
||||||
|
|
||||||
* Mark `key` input as deprecated
|
* Mark `key` input as deprecated
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
#syntax=docker/dockerfile:1.1-experimental
|
|
||||||
|
|
||||||
FROM node:12 AS deps
|
|
||||||
WORKDIR /src
|
|
||||||
COPY package.json yarn.lock ./
|
|
||||||
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \
|
|
||||||
yarn install
|
|
||||||
|
|
||||||
FROM scratch AS update-yarn
|
|
||||||
COPY --from=deps /src/yarn.lock /
|
|
||||||
|
|
||||||
FROM deps AS validate-yarn
|
|
||||||
COPY .git .git
|
|
||||||
RUN status=$(git status --porcelain -- yarn.lock); if [ -n "$status" ]; then echo $status; exit 1; fi
|
|
||||||
|
|
||||||
FROM deps AS base
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
FROM base AS build
|
|
||||||
RUN yarn build
|
|
||||||
|
|
||||||
FROM deps AS test
|
|
||||||
ARG TARGETOS
|
|
||||||
ARG TARGETARCH
|
|
||||||
ENV RUNNER_TEMP=/tmp/github_runner
|
|
||||||
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
|
|
||||||
COPY . .
|
|
||||||
RUN yarn run test
|
|
||||||
|
|
||||||
FROM base AS run-format
|
|
||||||
RUN yarn run format
|
|
||||||
|
|
||||||
FROM scratch AS format
|
|
||||||
COPY --from=run-format /src/src/*.ts /src/
|
|
||||||
|
|
||||||
FROM base AS validate-format
|
|
||||||
RUN yarn run format-check
|
|
||||||
|
|
||||||
FROM scratch AS dist
|
|
||||||
COPY --from=build /src/dist/ /dist/
|
|
||||||
|
|
||||||
FROM build AS validate-build
|
|
||||||
RUN status=$(git status --porcelain -- dist); if [ -n "$status" ]; then echo $status; exit 1; fi
|
|
||||||
|
|
||||||
FROM base AS dev
|
|
||||||
ENTRYPOINT ["bash"]
|
|
||||||
@@ -11,27 +11,12 @@
|
|||||||
</p>
|
</p>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
___
|
---
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
* [Usage](#usage)
|
|
||||||
* [Workflow](#workflow)
|
|
||||||
* [Run on new tag](#run-on-new-tag)
|
|
||||||
* [Signing](#signing)
|
|
||||||
* [Upload artifacts](#upload-artifacts)
|
|
||||||
* [Install Only](#install-only)
|
|
||||||
* [Customizing](#customizing)
|
|
||||||
* [inputs](#inputs)
|
|
||||||
* [environment variables](#environment-variables)
|
|
||||||
* [Limitation](#limitation)
|
|
||||||
* [Development](#development)
|
|
||||||
* [License](#license)
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Workflow
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: goreleaser
|
name: goreleaser
|
||||||
|
|
||||||
@@ -46,26 +31,26 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
-
|
||||||
fetch-depth: 0
|
name: Unshallow
|
||||||
|
run: git fetch --prune --unshallow
|
||||||
-
|
-
|
||||||
name: Set up Go
|
name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.15
|
go-version: 1.13
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v2
|
uses: goreleaser/goreleaser-action@v1
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --rm-dist
|
args: release --rm-dist
|
||||||
|
key: ${{ secrets.YOUR_PRIVATE_KEY }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
|
|
||||||
> **IMPORTANT**: note the `fetch-depth: 0` input in `Checkout` step. It is required for the changelog to work correctly.
|
> **IMPORTANT**: note the `Unshallow` step. It is required for the changelog to work correctly.
|
||||||
|
|
||||||
### Run on new tag
|
|
||||||
|
|
||||||
If you want to run GoReleaser only on new tag, you can use this event:
|
If you want to run GoReleaser only on new tag, you can use this event:
|
||||||
|
|
||||||
@@ -81,98 +66,30 @@ Or with a condition on GoReleaser step:
|
|||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v2
|
uses: goreleaser/goreleaser-action@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --rm-dist
|
args: release --rm-dist
|
||||||
|
key: ${{ secrets.YOUR_PRIVATE_KEY }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
|
|
||||||
> For detailed instructions please follow GitHub Actions [workflow syntax](https://help.github.com/en/articles/workflow-syntax-for-github-actions#About-yaml-syntax-for-workflows).
|
> For detailed instructions please follow GitHub Actions [workflow syntax](https://help.github.com/en/articles/workflow-syntax-for-github-actions#About-yaml-syntax-for-workflows).
|
||||||
|
|
||||||
### Signing
|
|
||||||
|
|
||||||
If [signing is enabled](https://goreleaser.com/customization/#Signing) in your GoReleaser configuration, you can use the [Import GPG](https://github.com/crazy-max/ghaction-import-gpg) GitHub Action along with this one:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
-
|
|
||||||
name: Import GPG key
|
|
||||||
id: import_gpg
|
|
||||||
uses: crazy-max/ghaction-import-gpg@v3
|
|
||||||
with:
|
|
||||||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
||||||
passphrase: ${{ secrets.PASSPHRASE }}
|
|
||||||
-
|
|
||||||
name: Run GoReleaser
|
|
||||||
uses: goreleaser/goreleaser-action@v2
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
args: release --rm-dist
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
|
||||||
```
|
|
||||||
|
|
||||||
And reference the fingerprint in your signing configuration using the `GPG_FINGERPRINT` environment variable:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
signs:
|
|
||||||
- artifacts: checksum
|
|
||||||
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
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Install GoReleaser
|
|
||||||
uses: goreleaser/goreleaser-action@v2
|
|
||||||
with:
|
|
||||||
install-only: true
|
|
||||||
-
|
|
||||||
name: Show GoReleaser version
|
|
||||||
run: goreleaser -v
|
|
||||||
```
|
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
|
||||||
### inputs
|
### inputs
|
||||||
|
|
||||||
Following inputs can be used as `step.with` keys
|
Following inputs can be used as `step.with` keys
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|------------------|---------|-----------|-------------------------------------------|
|
|---------------|---------|-----------|-------------------------------------------|
|
||||||
| `version`**¹** | String | `latest` | GoReleaser version |
|
| `version` | String | `latest` | GoReleaser version. Example: `v0.117.0` |
|
||||||
| `args` | String | | Arguments to pass to GoReleaser |
|
| `args` | String | | Arguments to pass to GoReleaser |
|
||||||
| `workdir` | String | `.` | Working directory (below repository root) |
|
| `key` | String | | Private key to import |
|
||||||
| `install-only` | Bool | `false` | Just install GoReleaser |
|
| `workdir` | String | `.` | Working directory (below repository root) |
|
||||||
|
|
||||||
> **¹** Can be a fixed version like `v0.117.0` or a max satisfying semver one like `~> 0.132`. In this case this will return `v0.132.1`.
|
|
||||||
|
|
||||||
### environment variables
|
### environment variables
|
||||||
|
|
||||||
@@ -194,26 +111,27 @@ secret named `GH_PAT`, the step will look like this:
|
|||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Run GoReleaser
|
name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v2
|
uses: goreleaser/goreleaser-action@v1
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --rm-dist
|
args: release --rm-dist
|
||||||
|
key: ${{ secrets.YOUR_PRIVATE_KEY }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Development
|
## Signing
|
||||||
|
|
||||||
|
If signing is enabled in your GoReleaser configuration, populate the `key` input with your private key
|
||||||
|
and reference the key in your signing configuration, e.g.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
signs:
|
||||||
|
- artifacts: checksum
|
||||||
|
args: ["--batch", "-u", "<key id, fingerprint, email, ...>", "--output", "${signature}", "--detach-sign", "${artifact}"]
|
||||||
```
|
```
|
||||||
# format code and build javascript artifacts
|
|
||||||
docker buildx bake pre-checkin
|
|
||||||
|
|
||||||
# validate all code has correctly formatted and built
|
This feature is currently only compatible when using the default `gpg` command and a private key without a passphrase.
|
||||||
docker buildx bake validate
|
|
||||||
|
|
||||||
# run tests
|
|
||||||
docker buildx bake test
|
|
||||||
```
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
+3
-16
@@ -1,30 +1,17 @@
|
|||||||
import * as git from '../src/git';
|
import * as git from '../src/git';
|
||||||
|
|
||||||
describe('git', () => {
|
describe('git', () => {
|
||||||
it('returns git tag through describe', async () => {
|
it('returns git tag', async () => {
|
||||||
process.env.GITHUB_SHA = '309312125ed7a32fcd48f3a1e24dcafe669c186a';
|
|
||||||
const tag: string = await git.getTag();
|
const tag: string = await git.getTag();
|
||||||
console.log(`tag: ${tag}`);
|
console.log(tag);
|
||||||
expect(tag).not.toEqual('');
|
expect(tag).not.toEqual('');
|
||||||
});
|
});
|
||||||
it('returns git tag through GITHUB_SHA', async () => {
|
|
||||||
process.env.GITHUB_SHA = '6e37040623d14330555c7be1603a9182cf92d32a';
|
|
||||||
const tag: string = await git.getTag();
|
|
||||||
console.log(`tag: ${tag}`);
|
|
||||||
expect(tag).toEqual('v1');
|
|
||||||
});
|
|
||||||
it('returns git tag through GITHUB_REF', async () => {
|
|
||||||
process.env.GITHUB_REF = 'refs/tags/v2.2.1';
|
|
||||||
const tag: string = await git.getTag();
|
|
||||||
console.log(`tag: ${tag}`);
|
|
||||||
expect(tag).toEqual('v2.2.1');
|
|
||||||
});
|
|
||||||
it('checks if tag is dirty', async () => {
|
it('checks if tag is dirty', async () => {
|
||||||
expect(await git.isTagDirty('v1.3.1')).toBe(true);
|
expect(await git.isTagDirty('v1.3.1')).toBe(true);
|
||||||
});
|
});
|
||||||
it('returns short commit', async () => {
|
it('returns short commit', async () => {
|
||||||
const commit: string = await git.getShortCommit();
|
const commit: string = await git.getShortCommit();
|
||||||
console.log(`commit: ${commit}`);
|
console.log(commit);
|
||||||
expect(commit).not.toEqual('');
|
expect(commit).not.toEqual('');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,18 +3,14 @@ import * as github from '../src/github';
|
|||||||
describe('github', () => {
|
describe('github', () => {
|
||||||
it('returns latest GoReleaser GitHub release', async () => {
|
it('returns latest GoReleaser GitHub release', async () => {
|
||||||
const release = await github.getRelease('latest');
|
const release = await github.getRelease('latest');
|
||||||
|
console.log(release);
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
expect(release?.tag_name).not.toEqual('');
|
expect(release?.tag_name).not.toEqual('');
|
||||||
console.log(`tag_name: ${release?.tag_name}`);
|
|
||||||
});
|
});
|
||||||
it('returns v0.117.0 GoReleaser GitHub release', async () => {
|
it('returns v0.117.0 GoReleaser GitHub release', async () => {
|
||||||
const release = await github.getRelease('v0.117.0');
|
const release = await github.getRelease('v0.117.0');
|
||||||
|
console.log(release);
|
||||||
expect(release).not.toBeNull();
|
expect(release).not.toBeNull();
|
||||||
expect(release?.tag_name).toEqual('v0.117.0');
|
expect(release?.tag_name).toEqual('v0.117.0');
|
||||||
});
|
});
|
||||||
it('returns v0.132.1 GoReleaser GitHub release', async () => {
|
|
||||||
const release = await github.getRelease('~> 0.132');
|
|
||||||
expect(release).not.toBeNull();
|
|
||||||
expect(release?.tag_name).toEqual('v0.132.1');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ import * as installer from '../src/installer';
|
|||||||
describe('installer', () => {
|
describe('installer', () => {
|
||||||
it('acquires v0.117.0 version of GoReleaser', async () => {
|
it('acquires v0.117.0 version of GoReleaser', async () => {
|
||||||
const goreleaser = await installer.getGoReleaser('v0.117.0');
|
const goreleaser = await installer.getGoReleaser('v0.117.0');
|
||||||
|
console.log(goreleaser);
|
||||||
expect(fs.existsSync(goreleaser)).toBe(true);
|
expect(fs.existsSync(goreleaser)).toBe(true);
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
it('acquires latest version of GoReleaser', async () => {
|
it('acquires latest version of GoReleaser', async () => {
|
||||||
const goreleaser = await installer.getGoReleaser('latest');
|
const goreleaser = await installer.getGoReleaser('latest');
|
||||||
|
console.log(goreleaser);
|
||||||
expect(fs.existsSync(goreleaser)).toBe(true);
|
expect(fs.existsSync(goreleaser)).toBe(true);
|
||||||
}, 100000);
|
}, 100000);
|
||||||
});
|
});
|
||||||
|
|||||||
+4
-8
@@ -8,20 +8,16 @@ branding:
|
|||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: 'GoReleaser version'
|
description: 'GoReleaser version. Example: v0.118.0'
|
||||||
default: 'latest'
|
default: 'latest'
|
||||||
required: false
|
|
||||||
args:
|
args:
|
||||||
description: 'Arguments to pass to GoReleaser'
|
description: 'Arguments to pass to GoReleaser'
|
||||||
required: false
|
key:
|
||||||
|
description: 'Deprecated. Use goreleaser/goreleaser-action@v2 alongside crazy-max/ghaction-import-gpg'
|
||||||
|
deprecationMessage: 'The key input will not be supported. Use goreleaser/goreleaser-action@v2 alongside crazy-max/ghaction-import-gpg'
|
||||||
workdir:
|
workdir:
|
||||||
description: 'Working directory (below repository root)'
|
description: 'Working directory (below repository root)'
|
||||||
default: '.'
|
default: '.'
|
||||||
required: false
|
|
||||||
install-only:
|
|
||||||
description: 'Just install GoReleaser'
|
|
||||||
default: 'false'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
|
|||||||
+2643
-4529
File diff suppressed because it is too large
Load Diff
@@ -1,53 +0,0 @@
|
|||||||
group "default" {
|
|
||||||
targets = ["build"]
|
|
||||||
}
|
|
||||||
|
|
||||||
group "pre-checkin" {
|
|
||||||
targets = ["update-yarn", "format", "build"]
|
|
||||||
}
|
|
||||||
|
|
||||||
group "validate" {
|
|
||||||
targets = ["validate-format", "validate-build", "validate-yarn"]
|
|
||||||
}
|
|
||||||
|
|
||||||
target "dockerfile" {
|
|
||||||
dockerfile = "Dockerfile.dev"
|
|
||||||
}
|
|
||||||
|
|
||||||
target "update-yarn" {
|
|
||||||
inherits = ["dockerfile"]
|
|
||||||
target = "update-yarn"
|
|
||||||
output = ["."]
|
|
||||||
}
|
|
||||||
|
|
||||||
target "build" {
|
|
||||||
inherits = ["dockerfile"]
|
|
||||||
target = "dist"
|
|
||||||
output = ["."]
|
|
||||||
}
|
|
||||||
|
|
||||||
target "test" {
|
|
||||||
inherits = ["dockerfile"]
|
|
||||||
target = "test"
|
|
||||||
}
|
|
||||||
|
|
||||||
target "format" {
|
|
||||||
inherits = ["dockerfile"]
|
|
||||||
target = "format"
|
|
||||||
output = ["."]
|
|
||||||
}
|
|
||||||
|
|
||||||
target "validate-format" {
|
|
||||||
inherits = ["dockerfile"]
|
|
||||||
target = "validate-format"
|
|
||||||
}
|
|
||||||
|
|
||||||
target "validate-build" {
|
|
||||||
inherits = ["dockerfile"]
|
|
||||||
target = "validate-build"
|
|
||||||
}
|
|
||||||
|
|
||||||
target "validate-yarn" {
|
|
||||||
inherits = ["dockerfile"]
|
|
||||||
target = "validate-yarn"
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
module github.com/goreleaser/goreleaser-action
|
module github.com/goreleaser/goreleaser-action
|
||||||
|
|
||||||
go 1.15
|
go 1.12
|
||||||
|
|||||||
+1
-5
@@ -1,14 +1,10 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
clearMocks: true,
|
clearMocks: true,
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
moduleFileExtensions: ['js', 'ts'],
|
||||||
setupFiles: [
|
setupFiles: ["dotenv/config"],
|
||||||
"dotenv/config",
|
|
||||||
"<rootDir>/src/test_setup.ts"
|
|
||||||
],
|
|
||||||
testEnvironment: 'node',
|
testEnvironment: 'node',
|
||||||
testMatch: ['**/*.test.ts'],
|
testMatch: ['**/*.test.ts'],
|
||||||
testRunner: 'jest-circus/runner',
|
testRunner: 'jest-circus/runner',
|
||||||
testTimeout: 10000,
|
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.ts$': 'ts-jest'
|
'^.+\\.ts$': 'ts-jest'
|
||||||
},
|
},
|
||||||
|
|||||||
Generated
+7490
File diff suppressed because it is too large
Load Diff
+16
-15
@@ -7,7 +7,8 @@
|
|||||||
"test": "jest --coverage",
|
"test": "jest --coverage",
|
||||||
"format": "prettier --write **/*.ts",
|
"format": "prettier --write **/*.ts",
|
||||||
"format-check": "prettier --check **/*.ts",
|
"format-check": "prettier --check **/*.ts",
|
||||||
"pre-checkin": "yarn run format && yarn run build"
|
"cleanup-paths": "removeNPMAbsolutePaths ./ --force --fields _where _args",
|
||||||
|
"pre-checkin": "npm run format && npm run cleanup-paths && npm run build"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -21,23 +22,23 @@
|
|||||||
"author": "CrazyMax",
|
"author": "CrazyMax",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.2.4",
|
||||||
"@actions/exec": "^1.0.4",
|
"@actions/exec": "^1.0.4",
|
||||||
"@actions/http-client": "^1.0.9",
|
"@actions/http-client": "^1.0.8",
|
||||||
"@actions/tool-cache": "^1.6.1"
|
"@actions/tool-cache": "^1.3.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^26.0.14",
|
"@types/jest": "^25.2.1",
|
||||||
"@types/node": "^14.11.2",
|
"@types/node": "^13.13.5",
|
||||||
"@vercel/ncc": "^0.24.1",
|
"@zeit/ncc": "^0.22.1",
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
"jest": "^26.4.2",
|
"jest": "^25.5.4",
|
||||||
"jest-circus": "^26.4.2",
|
"jest-circus": "^26.0.1",
|
||||||
"jest-runtime": "^26.4.2",
|
"jest-runtime": "^26.0.1",
|
||||||
"prettier": "^2.1.2",
|
"prettier": "^2.0.5",
|
||||||
"tmp": "^0.2.1",
|
"removeNPMAbsolutePaths": "^2.0.0",
|
||||||
"ts-jest": "^26.4.1",
|
"ts-jest": "^25.5.0",
|
||||||
"typescript": "^4.0.3",
|
"typescript": "^3.8.3",
|
||||||
"typescript-formatter": "^7.2.2"
|
"typescript-formatter": "^7.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-14
@@ -11,20 +11,7 @@ const git = async (args: string[] = []): Promise<string> => {
|
|||||||
|
|
||||||
export async function getTag(): Promise<string> {
|
export async function getTag(): Promise<string> {
|
||||||
try {
|
try {
|
||||||
if ((process.env.GITHUB_REF || '').startsWith('refs/tags')) {
|
return await git(['describe', '--tags', '--abbrev=0']);
|
||||||
const tag = (process.env.GITHUB_REF || '').split('/').pop();
|
|
||||||
if (tag !== '' && tag !== undefined) {
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return await git(['tag', '--points-at', `${process.env.GITHUB_SHA}`, '--sort', '-version:creatordate']).then(
|
|
||||||
tags => {
|
|
||||||
if (tags.length == 0) {
|
|
||||||
return git(['describe', '--tags', '--abbrev=0']);
|
|
||||||
}
|
|
||||||
return tags.split('\n')[0];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-32
@@ -1,6 +1,4 @@
|
|||||||
import * as httpm from '@actions/http-client';
|
import * as httpm from '@actions/http-client';
|
||||||
import * as core from '@actions/core';
|
|
||||||
import * as semver from 'semver';
|
|
||||||
|
|
||||||
export interface GitHubRelease {
|
export interface GitHubRelease {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -8,36 +6,7 @@ export interface GitHubRelease {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getRelease = async (version: string): Promise<GitHubRelease | null> => {
|
export const getRelease = async (version: string): Promise<GitHubRelease | null> => {
|
||||||
const resolvedVersion: string = (await resolveVersion(version)) || version;
|
const url: string = `https://github.com/goreleaser/goreleaser/releases/${version}`;
|
||||||
const url: string = `https://github.com/goreleaser/goreleaser/releases/${resolvedVersion}`;
|
|
||||||
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
|
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
|
||||||
return (await http.getJson<GitHubRelease>(url)).result;
|
return (await http.getJson<GitHubRelease>(url)).result;
|
||||||
};
|
};
|
||||||
|
|
||||||
const resolveVersion = async (version: string): Promise<string | null> => {
|
|
||||||
const allTags: Array<string> | null = await getAllTags();
|
|
||||||
if (!allTags) {
|
|
||||||
throw new Error(`Cannot find GoReleaser tags`);
|
|
||||||
}
|
|
||||||
core.debug(`Found ${allTags.length} tags in total`);
|
|
||||||
|
|
||||||
return semver.maxSatisfying(allTags, version);
|
|
||||||
};
|
|
||||||
|
|
||||||
interface GitHubTag {
|
|
||||||
tag_name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const getAllTags = async (): Promise<Array<string>> => {
|
|
||||||
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
|
|
||||||
const url: string = `https://goreleaser.com/static/releases.json`;
|
|
||||||
const getTags = http.getJson<Array<GitHubTag>>(url);
|
|
||||||
|
|
||||||
return getTags.then(response => {
|
|
||||||
if (response.result == null) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return response.result.map(obj => obj.tag_name);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|||||||
+12
-16
@@ -2,35 +2,25 @@ import * as git from './git';
|
|||||||
import * as installer from './installer';
|
import * as installer from './installer';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as exec from '@actions/exec';
|
import * as exec from '@actions/exec';
|
||||||
import {dirname} from 'path';
|
import * as fs from 'fs';
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const version = core.getInput('version') || 'latest';
|
const version = core.getInput('version') || 'latest';
|
||||||
const args = core.getInput('args');
|
const args = core.getInput('args');
|
||||||
|
const key = core.getInput('key');
|
||||||
const workdir = core.getInput('workdir') || '.';
|
const workdir = core.getInput('workdir') || '.';
|
||||||
const isInstallOnly = /^true$/i.test(core.getInput('install-only'));
|
|
||||||
const goreleaser = await installer.getGoReleaser(version);
|
const goreleaser = await installer.getGoReleaser(version);
|
||||||
core.info(`✅ GoReleaser installed successfully`);
|
|
||||||
|
|
||||||
if (isInstallOnly) {
|
const commit = await git.getShortCommit();
|
||||||
const goreleaserDir = dirname(goreleaser);
|
const tag = await git.getTag();
|
||||||
core.addPath(goreleaserDir);
|
const isTagDirty = await git.isTagDirty(tag);
|
||||||
core.debug(`Added ${goreleaserDir} to PATH`);
|
|
||||||
return;
|
|
||||||
} else if (!args) {
|
|
||||||
throw new Error('args input required');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (workdir && workdir !== '.') {
|
if (workdir && workdir !== '.') {
|
||||||
core.info(`📂 Using ${workdir} as working directory...`);
|
core.info(`📂 Using ${workdir} as working directory...`);
|
||||||
process.chdir(workdir);
|
process.chdir(workdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
const commit = await git.getShortCommit();
|
|
||||||
const tag = await git.getTag();
|
|
||||||
const isTagDirty = await git.isTagDirty(tag);
|
|
||||||
|
|
||||||
let snapshot = '';
|
let snapshot = '';
|
||||||
if (args.split(' ').indexOf('release') > -1) {
|
if (args.split(' ').indexOf('release') > -1) {
|
||||||
if (isTagDirty) {
|
if (isTagDirty) {
|
||||||
@@ -43,8 +33,14 @@ async function run(): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (key) {
|
||||||
|
core.info('🔑 Importing signing key...');
|
||||||
|
let path = `${process.env.HOME}/key.asc`;
|
||||||
|
fs.writeFileSync(path, key, {mode: 0o600});
|
||||||
|
await exec.exec('gpg', ['--import', path]);
|
||||||
|
}
|
||||||
|
|
||||||
core.info('🏃 Running GoReleaser...');
|
core.info('🏃 Running GoReleaser...');
|
||||||
process.env.GORELEASER_CURRENT_TAG = tag;
|
|
||||||
await exec.exec(`${goreleaser} ${args}${snapshot}`);
|
await exec.exec(`${goreleaser} ${args}${snapshot}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import tmp = require('tmp');
|
|
||||||
|
|
||||||
tmp.setGracefulCleanup();
|
|
||||||
const tmpdir = tmp.dirSync({template: 'goreleaser-XXXXXX'});
|
|
||||||
process.env = Object.assign(process.env, {
|
|
||||||
RUNNER_TEMP: tmpdir.name,
|
|
||||||
RUNNER_TOOL_CACHE: tmpdir.name,
|
|
||||||
GITHUB_ACTION: '1'
|
|
||||||
});
|
|
||||||
+1
-2
@@ -3,8 +3,7 @@
|
|||||||
"target": "es6",
|
"target": "es6",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"lib": [
|
"lib": [
|
||||||
"es6",
|
"es6"
|
||||||
"dom"
|
|
||||||
],
|
],
|
||||||
"newLine": "lf",
|
"newLine": "lf",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
|
|||||||
Reference in New Issue
Block a user