Skip to content

Commit 73bd21d

Browse files
authored
Feat/maintanance 2024 05 (#171)
1 parent a71d288 commit 73bd21d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+528
-1277
lines changed

.github/workflows/Release.yaml

Lines changed: 52 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,69 @@ on:
1313
- "CHANGELOG.md"
1414

1515
jobs:
16-
create_release:
16+
create-release:
1717
uses: fullstack-devops/git-workflows/.github/workflows/create-release.yml@main
1818
secrets:
1919
token: ${{ secrets.GITHUB_TOKEN }}
2020

21+
quality-gate:
22+
runs-on: ubuntu-latest
23+
needs: [create-release]
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
- name: Set up Go
28+
uses: actions/setup-go@v5
29+
with:
30+
go-version-file: go.mod
31+
cache: true
32+
33+
- name: Test
34+
run: make test/cover
35+
- name: Audit
36+
run: make audit
37+
38+
- name: debugging git
39+
run: |
40+
echo "git name-rev HEAD: $(git name-rev HEAD)"
41+
echo "git log -1 --pretty=format:"%s": $(git log -1 --pretty=format:"%s")"
42+
echo "git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@': $(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"
43+
2144
build:
2245
runs-on: ubuntu-latest
23-
needs: create_release
46+
needs: [create-release, quality-gate]
2447
steps:
2548
- name: Checkout code
26-
uses: actions/checkout@v3
49+
uses: actions/checkout@v4
2750
with:
2851
fetch-depth: 0
2952
- name: Set up Go
30-
uses: actions/setup-go@v4
53+
uses: actions/setup-go@v5
3154
with:
32-
go-version: 1.19
55+
go-version-file: go.mod
56+
cache: true
3357

3458
- name: Build
3559
run: make
3660
env:
37-
VERSION: "${{ needs.create_release.outputs.version }}"
61+
VERSION: "${{ needs.create-release.outputs.version }}"
3862

39-
- name: Test
40-
run: make test
63+
- name: Setup UPX
64+
uses: crazy-max/ghaction-upx@v3
65+
with:
66+
install-only: true
67+
- name: Compress binaries with upx
68+
run: make upx
69+
env:
70+
VERSION: "${{ needs.generate-infos.outputs.version }}"
4171

4272
- name: create changelog & update release-template.md
4373
run: make chglog
4474
env:
45-
LATEST_VERSION: "${{ needs.create_release.outputs.latest-version }}"
75+
LATEST_VERSION: "${{ needs.create-release.outputs.latest-version }}"
4676

4777
- name: Cache build outputs
48-
uses: actions/cache@v3
78+
uses: actions/cache@v4
4979
env:
5080
cache-name: cache-outputs-modules
5181
with:
@@ -54,18 +84,18 @@ jobs:
5484
restore-keys: |
5585
awesome-ci-${{ github.sha }}
5686
57-
publish_release:
87+
publish-release:
5888
environment: production
5989
runs-on: ubuntu-latest
60-
needs: [create_release, build]
90+
needs: [create-release, build]
6191
steps:
6292
- name: Checkout code
63-
uses: actions/checkout@v3
93+
uses: actions/checkout@v4
6494
- name: Setup awesome-ci
6595
uses: fullstack-devops/awesome-ci-action@main
6696

6797
- name: get cached build outputs
68-
uses: actions/cache@v3
98+
uses: actions/cache@v4
6999
env:
70100
cache-name: cache-outputs-modules
71101
with:
@@ -78,22 +108,22 @@ jobs:
78108

79109
- name: Publish Release
80110
run: >-
81-
awesome-ci release publish --release-id ${{ needs.create_release.outputs.releaseid }}
82-
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_linux-amd64"
83-
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_linux-arm64"
84-
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_windows-amd64.exe"
85-
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_windows-arm64.exe"
111+
awesome-ci release publish --release-id ${{ needs.create-release.outputs.releaseid }}
112+
-a "file=build/package/awesome-ci_${{ needs.create-release.outputs.version }}_linux-amd64"
113+
-a "file=build/package/awesome-ci_${{ needs.create-release.outputs.version }}_linux-arm64"
114+
-a "file=build/package/awesome-ci_${{ needs.create-release.outputs.version }}_windows-amd64.exe"
115+
-a "file=build/package/awesome-ci_${{ needs.create-release.outputs.version }}_windows-arm64.exe"
86116
-a "file=build/package/CHANGELOG.md"
87117
--body "build/package/release-template.md"
88118
env:
89119
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90120

91121
update_action:
92122
runs-on: ubuntu-latest
93-
needs: [create_release, publish_release]
123+
needs: [create-release, publish-release]
94124
steps:
95125
- name: Check out awesome-ci-action
96-
uses: actions/checkout@v3
126+
uses: actions/checkout@v4
97127
with:
98128
repository: fullstack-devops/awesome-ci-action
99129
token: ${{ secrets.ACI_REPO_TOKEN }}
@@ -111,4 +141,4 @@ jobs:
111141
git tag v$NEW_VERSION -m "update to version v$NEW_VERSION"
112142
git push --follow-tags
113143
env:
114-
NEW_VERSION: ${{ needs.create_release.outputs.version }}
144+
NEW_VERSION: ${{ needs.create-release.outputs.version }}

.github/workflows/branchPR.yaml

Lines changed: 42 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,80 +4,72 @@ on:
44
pull_request:
55

66
jobs:
7-
generate_infos:
7+
generate-infos:
88
uses: fullstack-devops/git-workflows/.github/workflows/generate-build-infos.yml@main
99
secrets:
1010
token: ${{ secrets.GITHUB_TOKEN }}
1111

12-
build:
12+
quality-gate:
1313
runs-on: ubuntu-latest
14-
needs: generate_infos
14+
needs: [generate-infos]
1515
steps:
16-
- run: export
1716
- name: Checkout code
18-
uses: actions/checkout@v3
19-
with:
20-
fetch-depth: 0
17+
uses: actions/checkout@v4
2118
- name: Set up Go
22-
uses: actions/setup-go@v4
19+
uses: actions/setup-go@v5
2320
with:
24-
go-version: 1.19
25-
26-
- name: Build
27-
run: make
28-
env:
29-
VERSION: "${{ needs.generate_infos.outputs.version }}"
21+
go-version-file: go.mod
22+
cache: true
3023

3124
- name: Test
32-
run: make test
25+
run: make test/cover
26+
- name: Audit
27+
run: make audit
3328

3429
- name: debugging git
3530
run: |
3631
echo "git name-rev HEAD: $(git name-rev HEAD)"
3732
echo "git log -1 --pretty=format:"%s": $(git log -1 --pretty=format:"%s")"
3833
echo "git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@': $(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"
3934
40-
- name: test build Infos
41-
run: build/package/awesome-ci_${{ needs.generate_infos.outputs.version }}_linux-amd64 pr info -n ${{ github.event.pull_request.number }} -v > $GITHUB_STEP_SUMMARY
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
- name: test env file
45-
run: export | grep ACI_
46-
47-
- name: create changelog & update release-template.md
48-
run: make chglog
49-
env:
50-
LATEST_VERSION: "${{ needs.generate_infos.outputs.latest-version }}"
51-
52-
- name: Cache build outputs
53-
uses: actions/cache@v3
54-
env:
55-
cache-name: cache-outputs-modules
56-
with:
57-
path: build/package/
58-
key: awesome-ci-${{ github.event.pull_request.head.sha }}-${{ hashFiles('build/package/awesome-ci*') }}
59-
restore-keys: |
60-
awesome-ci-${{ github.event.pull_request.head.sha }}
61-
62-
create_release_test:
35+
build:
6336
runs-on: ubuntu-latest
64-
needs: [generate_infos, build]
37+
needs: [generate-infos, quality-gate]
6538
steps:
6639
- name: Checkout code
67-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
6841
with:
6942
fetch-depth: 0
43+
- name: Set up Go
44+
uses: actions/setup-go@v5
45+
with:
46+
go-version-file: go.mod
47+
cache: true
48+
49+
- name: Build
50+
run: make
51+
env:
52+
VERSION: "${{ needs.generate-infos.outputs.version }}"
7053

71-
- name: get cached build outputs
72-
uses: actions/cache@v3
54+
- name: Setup UPX
55+
uses: crazy-max/ghaction-upx@v3
56+
with:
57+
install-only: true
58+
- name: Compress binaries with upx
59+
run: make upx
7360
env:
74-
cache-name: cache-outputs-modules
61+
VERSION: "${{ needs.generate-infos.outputs.version }}"
62+
63+
- name: upload artifacts
64+
uses: actions/upload-artifact@v4
7565
with:
76-
path: build/package/
77-
key: awesome-ci-${{ github.event.pull_request.head.sha }}
66+
name: awesome-ci-binaries
67+
path: |
68+
build/package/awesome-ci_*
7869
79-
- name: get generated artifacts
80-
working-directory: build/package
81-
run: |
82-
ls -la
83-
cat release-template.md
70+
- name: (integration testing) test build Infos
71+
run: build/package/awesome-ci_${{ needs.generate-infos.outputs.version }}_linux-amd64 pr info -n ${{ github.event.pull_request.number }} -v > $GITHUB_STEP_SUMMARY
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
- name: (integration testing) test env file
75+
run: export | grep ACI_

.github/workflows/gh-pages-deploy.yaml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,50 @@ on:
44
push:
55
branches:
66
- main
7+
pull_request:
8+
branches:
9+
- main
710

811
jobs:
9-
deploy:
10-
name: Deploy to GitHub Pages
12+
build:
13+
name: Build Docusaurus
1114
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
working-directory: docs
1218
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-node@v3
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- uses: actions/setup-node@v4
1523
with:
16-
node-version: 16
24+
node-version: 18
1725
cache: yarn
18-
cache-dependency-path: docs
26+
cache-dependency-path: docs/yarn.lock
1927

2028
- name: Install dependencies
21-
working-directory: docs
2229
run: yarn install --frozen-lockfile
2330
- name: Build website
24-
working-directory: docs
2531
run: yarn build
2632

27-
- name: Deploy to GitHub Pages
28-
uses: peaceiris/actions-gh-pages@v3
33+
- name: Upload Build Artifact
34+
if: github.ref == 'refs/heads/main'
35+
uses: actions/upload-pages-artifact@v3
2936
with:
30-
github_token: ${{ secrets.GITHUB_TOKEN }}
31-
publish_dir: ./docs/build
32-
user_name: fullstack-devops[bot]
33-
user_email: fullstack-devops[bot]@users.noreply.github.com
37+
path: docs/build
38+
39+
deploy:
40+
name: Deploy to GitHub Pages
41+
if: github.ref == 'refs/heads/main'
42+
needs: build
43+
permissions:
44+
pages: write
45+
id-token: write
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

.github/workflows/gh-pages-test-deploy.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.gitignore

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313

1414
# Output of the go coverage tool, specifically when used with LiteIDE
1515
*.out
16-
out/*
1716

1817
# Dependency directories (remove the comment below to include it)
1918
# vendor/
2019

2120
# Go workspace file
22-
go.work
23-
/docs/architecture/.asciidoctor/
24-
/build/docs/.asciidoctor/
25-
/build/**
26-
!/build/**/.keep
21+
/build/coverage/**
22+
/build/docs/**
23+
/build/package/**
24+
!/build/**/.gitkeep
25+
2726
/.idea
2827

2928
*.env

0 commit comments

Comments
 (0)