mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-07-05 03:54:46 +00:00
fixup! fixup! fixup! fixup! Switch to goreleaser.
This commit is contained in:
@@ -114,29 +114,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
args: ./...
|
args: ./...
|
||||||
|
|
||||||
# create-dummy-release:
|
build-docker:
|
||||||
# needs: [ prepare, test, code_scans ]
|
|
||||||
# name: Create empty release
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# steps:
|
|
||||||
# - name: Checkout repo
|
|
||||||
# uses: actions/checkout@v3
|
|
||||||
# - name: Get list of the commits since last release
|
|
||||||
# run: |
|
|
||||||
# echo "$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s")" > .release_notes
|
|
||||||
# - name: Create empty release
|
|
||||||
# uses: ncipollo/release-action@v1
|
|
||||||
# with:
|
|
||||||
# bodyFile: ./.release_notes
|
|
||||||
# name: version ${{ needs.prepare.outputs.RELEASE_VERSION }}
|
|
||||||
# token: ${{ secrets.GHCR_TOKEN }}
|
|
||||||
# tag: ${{ needs.prepare.outputs.RELEASE_VERSION }}
|
|
||||||
# prerelease: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
|
|
||||||
# allowUpdates: true
|
|
||||||
|
|
||||||
build:
|
|
||||||
needs: [ prepare, test, code_scans ]
|
needs: [ prepare, test, code_scans ]
|
||||||
name: Docker image build (regular:multiarch)
|
name: Docker image build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
@@ -211,20 +191,40 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
- name: Build binaries
|
||||||
- name: Compile and release semver
|
run: |
|
||||||
uses: goreleaser/goreleaser-action@v4
|
LOCAL_VERSION=${{ needs.prepare.outputs.RELEASE_VERSION }} make dist-release
|
||||||
|
- name: Upload binaries
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
version: latest
|
name: binaries
|
||||||
args: release --rm-dist --skip-validate --skip-publish --skip-sign
|
path: dist/
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GHCR_TOKEN }}
|
create-release:
|
||||||
|
needs: [ build-binary, build-docker ]
|
||||||
|
name: Create empty release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Get list of the commits since last release
|
||||||
|
run: |
|
||||||
|
echo "$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s")" > .release_notes
|
||||||
|
- name: Create release
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
bodyFile: ./.release_notes
|
||||||
|
name: version ${{ needs.prepare.outputs.RELEASE_VERSION }}
|
||||||
|
token: ${{ secrets.GHCR_TOKEN }}
|
||||||
|
tag: ${{ needs.prepare.outputs.RELEASE_VERSION }}
|
||||||
|
prerelease: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
|
||||||
|
artifacts: "dist/*"
|
||||||
|
allowUpdates: true
|
||||||
|
|
||||||
# - name: Compile and release semver
|
# - name: Compile and release semver
|
||||||
# uses: wangyoucao577/go-release-action@v1.34
|
# uses: wangyoucao577/go-release-action@v1.34
|
||||||
# with:
|
# with:
|
||||||
|
|||||||
+3
-1
@@ -1,2 +1,4 @@
|
|||||||
semver-gen
|
semver-gen
|
||||||
coverage.out
|
coverage.out
|
||||||
|
.vscode
|
||||||
|
.DS_Store
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
builds:
|
|
||||||
-
|
|
||||||
ldflags:
|
|
||||||
- -s -w -X main.PKG_VERSION={{.Version}}
|
|
||||||
env:
|
|
||||||
- CGO_ENABLED=0
|
|
||||||
- GO111MODULE=on
|
|
||||||
- >-
|
|
||||||
{{- if eq .Os "darwin" }}
|
|
||||||
GOOS=darwin
|
|
||||||
GOARCH={{ .Arch }}
|
|
||||||
# - >-
|
|
||||||
# {{- if eq .Os "darwin" }}
|
|
||||||
# {{- if eq .Arch "amd64"}}CC=o64-clang{{- end }}
|
|
||||||
# {{- if eq .Arch "arm64"}}CC=aarch64-apple-darwin20.2-clang{{- end }}
|
|
||||||
# {{- end }}
|
|
||||||
# {{- if eq .Os "windows" }}
|
|
||||||
# {{- if eq .Arch "amd64" }}CC=x86_64-w64-mingw32-gcc{{- end }}
|
|
||||||
# {{- end }}
|
|
||||||
binary: semver-gen-{{ .Os }}-{{ .Arch }}
|
|
||||||
no_unique_dist_dir: true
|
|
||||||
# buildmode: c-shared
|
|
||||||
builder: go
|
|
||||||
ignore:
|
|
||||||
- goos: windows
|
|
||||||
goarch: 386
|
|
||||||
- goos: windows
|
|
||||||
goarch: arm64
|
|
||||||
- goos: windows
|
|
||||||
goarch: amd64
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
LOCAL_VERSION?=""
|
LOCAL_VERSION?=""
|
||||||
CI_RUN?=false
|
CI_RUN?=false
|
||||||
ADDITIONAL_BUILD_FLAGS=""
|
ADDITIONAL_BUILD_FLAGS=""
|
||||||
|
LDFLAGS=-s -w -X main.PKG_VERSION=${LOCAL_VERSION}
|
||||||
|
|
||||||
ifeq ($(CI_RUN), true)
|
ifeq ($(CI_RUN), true)
|
||||||
ADDITIONAL_BUILD_FLAGS="-test.short"
|
ADDITIONAL_BUILD_FLAGS="-test.short"
|
||||||
@@ -38,3 +39,12 @@ update: ## Update dependencies
|
|||||||
.PHONY: update-all
|
.PHONY: update-all
|
||||||
update-all: ## Update all dependencies and sub-packages
|
update-all: ## Update all dependencies and sub-packages
|
||||||
@go get -u ./...
|
@go get -u ./...
|
||||||
|
|
||||||
|
dist-release: ## Build all binaries
|
||||||
|
rm -fr dist/ || true
|
||||||
|
mkdir -p dist/
|
||||||
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o dist/semver-gen-linux-amd64
|
||||||
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o dist/semver-gen-linux-arm64
|
||||||
|
CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o dist/semver-gen-darwin-amd64
|
||||||
|
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o dist/semver-gen-darwin-arm64
|
||||||
|
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o dist/semver-gen-windows-amd64.exe
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
// go:build (darwin && cgo) || linux
|
|
||||||
//go:build (darwin && cgo) || linux
|
|
||||||
// +build darwin,cgo linux
|
|
||||||
|
|
||||||
// Project: semver-generator
|
// Project: semver-generator
|
||||||
/*
|
/*
|
||||||
Copyright © 2021 LUKASZ RACZYLO <lukasz$raczylo,com>
|
Copyright © 2021 LUKASZ RACZYLO <lukasz$raczylo,com>
|
||||||
|
|||||||
Reference in New Issue
Block a user