Skip to content

Commit d532fc7

Browse files
authored
fix: release not building (#143)
1 parent 617b8f7 commit d532fc7

File tree

6 files changed

+21
-29
lines changed

6 files changed

+21
-29
lines changed

.github/workflows/Release.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
- name: Test
3636
run: make test
3737

38+
- name: create changelog & update release-template.md
39+
run: LATEST_VERSION="${{ needs.create_release.outputs.latest-version }}" make chglog
40+
3841
- name: Cache build outputs
3942
uses: actions/cache@v3
4043
env:
@@ -69,20 +72,15 @@ jobs:
6972
working-directory: build/package
7073
run: ls -la
7174

72-
- name: update changelog
73-
run: docker run -v "$PWD":/workdir quay.io/git-chglog/git-chglog -o CHANGELOG.md 1.0.0..
74-
- name: update changelog in template
75-
run: docker run -v "$PWD":/workdir quay.io/git-chglog/git-chglog ${{ needs.create_release.outputs.latest-version }}.. >> scripts/release-template.md
76-
7775
- name: Publish Release
7876
run: >-
7977
awesome-ci release publish --release-id ${{ needs.create_release.outputs.releaseid }}
8078
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_linux-amd64"
8179
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_linux-arm64"
8280
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_windows-amd64.exe"
8381
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_windows-arm64.exe"
84-
-a "file=CHANGELOG.md"
85-
--body "scripts/release-template.md"
82+
-a "file=build/package/CHANGELOG.md"
83+
--body "build/package/release-template.md"
8684
env:
8785
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8886

.github/workflows/branchPR.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
- name: test env file
4343
run: export | grep ACI_
4444

45+
- name: create changelog & update release-template.md
46+
run: LATEST_VERSION="${{ needs.generate_infos.outputs.latest-version }}" make chglog
47+
4548
- name: Cache build outputs
4649
uses: actions/cache@v3
4750
env:
@@ -58,6 +61,8 @@ jobs:
5861
steps:
5962
- name: Checkout code
6063
uses: actions/checkout@v3
64+
with:
65+
fetch-depth: 0
6166

6267
- name: get cached build outputs
6368
uses: actions/cache@v3
@@ -69,4 +74,6 @@ jobs:
6974

7075
- name: get generated artifacts
7176
working-directory: build/package
72-
run: ls -la
77+
run: |
78+
ls -la
79+
cat release-template.md

Makefile

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ PROJECT_PKG = github.com/fullstack-devops/awesome-ci
33
PKG_LIST = "github.com/fullstack-devops/awesome-ci/cmd/awesome-ci"
44
BUILD_DIR = ./build
55

6+
LATEST_VERSION ?= "1.0.0"
67
VERSION ?=$(shell git describe --tags --exact-match 2>/dev/null || echo "dev-pr")
78
COMMIT_HASH ?= $(shell git rev-parse --short HEAD 2>/dev/null)
89
BUILD_DATE ?= $(shell date +%FT%T%z)
@@ -36,15 +37,11 @@ test: ## Run unittests
3637
race: ## Run data race detector
3738
-go test -race -short -v ${PKG_LIST}
3839

39-
# this requires ruby with the gem asciidoctor, asciidoctor-pdf and asciidoctor-diagram installed -> gem install asciidoctor-**
40-
# also graphviz is required
41-
docs:
42-
asciidoctor -b html -r asciidoctor-diagram -d book -D build/docs ./docs/architecture/awesome-ci.adoc
43-
asciidoctor-pdf -r asciidoctor-diagram -d book -D build/docs ./docs/architecture/awesome-ci.adoc
44-
45-
docspodman:
46-
podman run --rm -it -v ./:/documents/ docker.io/asciidoctor/docker-asciidoctor asciidoctor -r asciidoctor-diagram -d book -D build/docs ./docs/architecture/awesome-ci.adoc
47-
podman run --rm -it -v ./:/documents/ docker.io/asciidoctor/docker-asciidoctor asciidoctor-pdf -r asciidoctor-diagram -d book -D build/docs ./docs/architecture/awesome-ci.adoc
40+
chglog:
41+
go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest
42+
cp scripts/release-template.md build/package/release-template.md
43+
git-chglog ${LATEST_VERSION}.. >> build/package/release-template.md
44+
git-chglog -o build/package/CHANGELOG.md 1.0.0..
4845

4946
coverage:
5047
-go test -covermode=count -coverprofile "${BUILD_DIR}/coverage/awesome-ci.cov" "github.com/fullstack-devops/awesome-ci/cmd/awesome-ci"
@@ -68,7 +65,6 @@ help:
6865
@echo awesome-ci - build awesome-ci
6966
@echo test - run tests
7067
@echo race - run race condition tests
68+
@echo chglog - install and create changelog with chglog
7169
@echo coverage - generate test coverage report
72-
@echo docs - generate end user/developer documents
73-
@echo docspodman - generate end user/developer documents with podman
7470
@echo clean - cleanup project direcotories

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ require (
4141
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
4242
github.com/kevinburke/ssh_config v1.2.0 // indirect
4343
github.com/mattn/go-colorable v0.1.13 // indirect
44-
github.com/mattn/go-isatty v0.0.17 // indirect
4544
github.com/pjbgf/sha1cd v0.3.0 // indirect
4645
github.com/sergi/go-diff v1.3.1 // indirect
4746
github.com/sirupsen/logrus v1.9.0

go.sum

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2B
44
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8=
55
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA=
66
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g=
7-
github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk=
87
github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
98
github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ=
109
github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
@@ -40,8 +39,6 @@ github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8
4039
github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg=
4140
github.com/go-git/go-git-fixtures/v4 v4.3.1 h1:y5z6dd3qi8Hl+stezc8p3JxDkoTRqMAlKnXHuzrfjTQ=
4241
github.com/go-git/go-git-fixtures/v4 v4.3.1/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo=
43-
github.com/go-git/go-git/v5 v5.5.2 h1:v8lgZa5k9ylUw+OR/roJHTxR4QItsNFI5nKtAXFuynw=
44-
github.com/go-git/go-git/v5 v5.5.2/go.mod h1:BE5hUJ5yaV2YMxhmaP4l6RBQ08kMxKSPD4BlxtH7OjI=
4542
github.com/go-git/go-git/v5 v5.6.0 h1:JvBdYfcttd+0kdpuWO7KTu0FYgCf5W0t5VwkWGobaa4=
4643
github.com/go-git/go-git/v5 v5.6.0/go.mod h1:6nmJ0tJ3N4noMV1Omv7rC5FG3/o8Cm51TB4CJp7mRmE=
4744
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -68,8 +65,6 @@ github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK
6865
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
6966
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
7067
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
71-
github.com/itchyny/gojq v0.12.11 h1:YhLueoHhHiN4mkfM+3AyJV6EPcCxKZsOnYf+aVSwaQw=
72-
github.com/itchyny/gojq v0.12.11/go.mod h1:o3FT8Gkbg/geT4pLI0tF3hvip5F3Y/uskjRz9OYa38g=
7368
github.com/itchyny/gojq v0.12.12 h1:x+xGI9BXqKoJQZkr95ibpe3cdrTbY8D9lonrK433rcA=
7469
github.com/itchyny/gojq v0.12.12/go.mod h1:j+3sVkjxwd7A7Z5jrbKibgOLn0ZfLWkV+Awxr/pyzJE=
7570
github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE=
@@ -97,11 +92,8 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
9792
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
9893
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
9994
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
100-
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
10195
github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM=
10296
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
103-
github.com/pjbgf/sha1cd v0.2.3 h1:uKQP/7QOzNtKYH7UTohZLcjF5/55EnTw0jO/Ru4jZwI=
104-
github.com/pjbgf/sha1cd v0.2.3/go.mod h1:HOK9QrgzdHpbc2Kzip0Q1yi3M2MFGPADtR6HjG65m5M=
10597
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
10698
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
10799
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=

internal/app/awesome-ci/service/release.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func ReleasePublish(args *ReleaseArgs, releaseId int64, assets []string) {
8484
for _, asset := range assets {
8585
assetInfo, err := tools.GetAsset(asset)
8686
if err != nil {
87-
log.Fatalln("not all specified assets available, please check")
87+
log.Fatalln("not all specified assets available, please check", err)
8888
}
8989
assetsEncoded = append(assetsEncoded, *assetInfo)
9090
}

0 commit comments

Comments
 (0)