Compare commits

..

4 Commits

Author SHA1 Message Date
lukaszraczylo 50282aa5f6 Fixup gomod and remove leftovers. 2022-10-17 13:04:02 +01:00
lukaszraczylo 5fa9728e0a Update dependencies to the latest available. 2022-10-17 13:00:38 +01:00
lukaszraczylo 084def2e9e Merge pull request #16 from lukaszraczylo/move-crossbuild
Change crossbuild to go-release-binaries.
2022-10-17 04:55:15 -07:00
lukaszraczylo 43b49666b6 Change crossbuild to go-release-binaries.
Reason: crossbuild action is deprecated and does not support current
latest versions of golang.
2022-10-17 12:49:07 +01:00
3 changed files with 89 additions and 53 deletions
+83 -47
View File
@@ -105,6 +105,26 @@ jobs:
with:
args: ./...
create-dummy-release:
needs: [ prepare, test, code_scans ]
name: Create empty release
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- 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 ]
name: Docker image build (regular:multiarch)
@@ -165,60 +185,76 @@ jobs:
# fail-build: false
build-binary:
needs: [ prepare, test, code_scans ]
needs: [ prepare, test, code_scans, create-dummy-release ]
name: Binary compilation and release
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
continue-on-error: [true]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Compile binary
uses: thatisuday/go-cross-build@v1.1.0
uses: wangyoucao577/go-release-action@v1.32
with:
platforms: linux/amd64,darwin/amd64,windows/amd64,linux/arm64,darwin/amd64,darwin/arm64
name: semver-gen
package: ./
compress: false
dest: dist
github_token: ${{ secrets.GHCR_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
ldflags: -s -w -X main.PKG_VERSION=${{ needs.prepare.outputs.RELEASE_VERSION }}
- 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
id: create_release
uses: marvinpinto/action-automatic-releases@latest
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
files: dist/semver-gen-*
automatic_release_tag: ${{ needs.prepare.outputs.RELEASE_VERSION }}
title: version ${{ needs.prepare.outputs.RELEASE_VERSION }}
# tag: ${{ needs.prepare.outputs.RELEASE_VERSION }}
# name: ${{ needs.prepare.outputs.RELEASE_VERSION }}
# body_path: .release_notes
# draft: false
prerelease: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
- name: Delete previous v1 release asset
uses: mknejp/delete-release-assets@v1
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
with:
token: ${{ github.token }}
fail-if-no-assets: false
fail-if-no-release: false
tag: v1
assets: 'semver-gen-*'
- name: Create Release V1
id: create_release_global
uses: marvinpinto/action-automatic-releases@latest
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
files: dist/semver-gen-*
automatic_release_tag: v1
title: version v1:${{ needs.prepare.outputs.RELEASE_VERSION }}
prerelease: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
project_path: .
binary_name: semver-gen
asset_name: semver-gen-${{ matrix.goos }}-${{ matrix.goarch }}
release_name: version ${{ needs.prepare.outputs.RELEASE_VERSION }}
release_tag: ${{ needs.prepare.outputs.RELEASE_VERSION }}
compress_assets: false
retry: 10
overwrite: true
pre_command: export GODEBUG=http2client=0
# - name: Create Release
# id: create_release
# uses: marvinpinto/action-automatic-releases@latest
# if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# files: dist/semver-gen-*
# automatic_release_tag: ${{ needs.prepare.outputs.RELEASE_VERSION }}
# title: version ${{ needs.prepare.outputs.RELEASE_VERSION }}
# # tag: ${{ needs.prepare.outputs.RELEASE_VERSION }}
# # name: ${{ needs.prepare.outputs.RELEASE_VERSION }}
# # body_path: .release_notes
# # draft: false
# prerelease: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
# - name: Delete previous v1 release asset
# uses: mknejp/delete-release-assets@v1
# if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
# with:
# token: ${{ github.token }}
# fail-if-no-assets: false
# fail-if-no-release: false
# tag: v1
# assets: 'semver-gen-*'
# - name: Create Release V1
# id: create_release_global
# uses: marvinpinto/action-automatic-releases@latest
# if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# files: dist/semver-gen-*
# automatic_release_tag: v1
# title: version v1:${{ needs.prepare.outputs.RELEASE_VERSION }}
# prerelease: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
+2 -2
View File
@@ -8,7 +8,7 @@ require (
github.com/lukaszraczylo/go-simple-graphql v1.0.61
github.com/lukaszraczylo/pandati v0.0.15
github.com/melbahja/got v0.7.0
github.com/spf13/cobra v1.5.0
github.com/spf13/cobra v1.6.0
github.com/spf13/viper v1.13.0
github.com/stretchr/testify v1.8.0
github.com/tidwall/gjson v1.14.3
@@ -26,7 +26,7 @@ require (
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
+4 -4
View File
@@ -158,8 +158,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
@@ -231,8 +231,8 @@ github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo=
github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI=
github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=