Skip to content
Snippets Groups Projects
Commit 8687cdb4 authored by Christoph Witzko's avatar Christoph Witzko
Browse files

feat: updater plugin lib

parent bacaf912
Branches
Tags v1.1.0
No related merge requests found
...@@ -28,12 +28,8 @@ jobs: ...@@ -28,12 +28,8 @@ jobs:
- uses: actions/setup-go@v1 - uses: actions/setup-go@v1
with: with:
go-version: 1.14 go-version: 1.14
- run: go build ./cmd/files-updater-npm/
- name: Build - run: go test -v ./...
run: go build ./cmd/files-updater-npm/
- name: Test
run: go test -v ./...
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
...@@ -43,8 +39,7 @@ jobs: ...@@ -43,8 +39,7 @@ jobs:
with: with:
go-version: 1.14 go-version: 1.14
- run: echo "::add-path::~/go/bin" - run: echo "::add-path::~/go/bin"
- name: Get release dependencies - run: |
run: |
go get github.com/mitchellh/gox go get github.com/mitchellh/gox
go get github.com/tcnksm/ghr go get github.com/tcnksm/ghr
- uses: go-semantic-release/action@v1 - uses: go-semantic-release/action@v1
...@@ -53,7 +48,8 @@ jobs: ...@@ -53,7 +48,8 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
ghr: true ghr: true
- run: | - run: |
gox -parallel 4 -osarch="linux/amd64 darwin/amd64 linux/arm windows/amd64" -ldflags="-extldflags '-static' -s -w" -output="bin/{{.Dir}}_v${{steps.semrel.outputs.version}}_{{.OS}}_{{.Arch}}" ./cmd/files-updater-npm/ gox -parallel 4 -osarch="linux/amd64 darwin/amd64 linux/arm windows/amd64" -ldflags="-extldflags '-static' -s -w -X github.com/go-semantic-release/files-updater-npm/pkg/updater.FUVERSION=${{steps.semrel.outputs.version}}" -output="bin/{{.Dir}}_v${{steps.semrel.outputs.version}}_{{.OS}}_{{.Arch}}" ./cmd/files-updater-npm/
cd bin/ && shasum -a 256 * > ./files-updater-npm_v${{steps.semrel.outputs.version}}_checksums.txt && cd -
if: steps.semrel.outputs.version != '' if: steps.semrel.outputs.version != ''
- run: ghr $(cat .ghr) bin/ - run: ghr $(cat .ghr) bin/
if: steps.semrel.outputs.version != '' if: steps.semrel.outputs.version != ''
......
...@@ -3,6 +3,6 @@ module github.com/go-semantic-release/files-updater-npm ...@@ -3,6 +3,6 @@ module github.com/go-semantic-release/files-updater-npm
go 1.14 go 1.14
require ( require (
github.com/go-semantic-release/semantic-release/v2 v2.1.0 github.com/go-semantic-release/semantic-release/v2 v2.3.0
github.com/stretchr/testify v1.6.1 github.com/stretchr/testify v1.6.1
) )
This diff is collapsed.
...@@ -9,9 +9,23 @@ import ( ...@@ -9,9 +9,23 @@ import (
const npmrc = "//registry.npmjs.org/:_authToken=${NPM_TOKEN}\n" const npmrc = "//registry.npmjs.org/:_authToken=${NPM_TOKEN}\n"
var FUVERSION = "dev"
type Updater struct { type Updater struct {
} }
func (u *Updater) Init(m map[string]string) error {
return nil
}
func (u *Updater) Name() string {
return "npm"
}
func (u *Updater) Version() string {
return FUVERSION
}
func (u *Updater) ForFiles() string { func (u *Updater) ForFiles() string {
return "package\\.json" return "package\\.json"
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment