Skip to content

Commit 14a8884

Browse files
committed
implement new wf
1 parent b7fbb7b commit 14a8884

File tree

3 files changed

+19
-44
lines changed

3 files changed

+19
-44
lines changed

.github/workflows/Release.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ jobs:
2020
build:
2121
runs-on: ubuntu-latest
2222
needs: create_release
23-
strategy:
24-
matrix:
25-
arch: ["amd64", "arm64"]
2623
steps:
2724
- name: Checkout code
2825
uses: actions/checkout@v3
@@ -31,11 +28,11 @@ jobs:
3128
with:
3229
go-version: 1.19
3330

34-
- name: Build "${{ matrix.arch }}"
31+
- name: Build
3532
run: make VERSION="${{ needs.create_release.outputs.version }}"
36-
env:
37-
GOOS: linux
38-
GOARCH: "${{ matrix.arch }}"
33+
34+
- name: Test
35+
run: make test
3936

4037
- name: Cache build outputs
4138
uses: actions/cache@v3
@@ -44,7 +41,6 @@ jobs:
4441
with:
4542
path: build/package/
4643
key: awesome-ci-${{ github.sha }}-${{ hashFiles('build/package/awesome-ci*') }}
47-
enableCrossOsArchive: true
4844
restore-keys: |
4945
awesome-ci-${{ github.sha }}
5046
@@ -70,11 +66,15 @@ jobs:
7066
run: ls -la
7167

7268
- name: Publish Release
73-
run: awesome-ci release publish -releaseid "$ACI_RELEASE_ID" -assets "file=build/package/$ARTIFACT1" -body "scripts/release-template.md"
69+
run: >-
70+
awesome-ci release publish --release-id ${{ needs.create_release.outputs.releaseid }}
71+
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_amd64"
72+
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_arm64"
73+
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_amd64.exe"
74+
-a "file=build/package/awesome-ci_${{ needs.create_release.outputs.version }}_arm64.exe"
75+
-body "scripts/release-template.md"
7476
env:
7577
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76-
ACI_RELEASE_ID: ${{ needs.create_release.outputs.releaseid }}
77-
ARTIFACT1: awesome-ci_${{ needs.create_release.outputs.version }}_amd64
7878

7979
update_action:
8080
runs-on: ubuntu-latest

.github/workflows/branchPR.yaml

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
needs: generate_infos
15-
strategy:
16-
matrix:
17-
arch: ["amd64", "arm64"]
1815
steps:
1916
- run: export
2017
- name: Checkout code
@@ -25,38 +22,25 @@ jobs:
2522
uses: actions/setup-go@v3
2623
with:
2724
go-version: 1.19
28-
- name: Setup awesome-ci
29-
uses: fullstack-devops/awesome-ci-action@main
3025

31-
- name: Build "${{ matrix.arch }}"
32-
run: make
33-
env:
34-
GOOS: linux
35-
GOARCH: "${{ matrix.arch }}"
26+
- name: Build
27+
run: make VERSION="${{ needs.generate_infos.outputs.version }}"
3628

37-
- name: Test "${{ matrix.arch }}"
38-
if: matrix.arch == 'amd64'
29+
- name: Test
3930
run: make test
4031

4132
- name: debugging git
42-
if: matrix.arch == 'amd64'
4333
run: |
4434
echo "git name-rev HEAD: $(git name-rev HEAD)"
4535
echo "git log -1 --pretty=format:"%s": $(git log -1 --pretty=format:"%s")"
4636
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/@@')"
4737
4838
- name: test build Infos
49-
id: test-build-infos
50-
if: matrix.arch == 'amd64'
51-
run: build/package/awesome-ci_* pr info -n ${{ github.event.pull_request.number }} -v > $GITHUB_STEP_SUMMARY
39+
run: build/package/awesome-ci_${{ needs.generate_infos.outputs.version }}_amd64 pr info -n ${{ github.event.pull_request.number }} -v > $GITHUB_STEP_SUMMARY
5240
env:
5341
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5442
- name: test env file
55-
if: matrix.arch == 'amd64'
5643
run: export | grep ACI_
57-
- name: test step export function
58-
if: matrix.arch == 'amd64'
59-
run: echo "${{ steps.test-build-infos.outputs.ACI_PR_BRANCH }}"
6044

6145
- name: Cache build outputs
6246
uses: actions/cache@v3
@@ -65,25 +49,15 @@ jobs:
6549
with:
6650
path: build/package/
6751
key: awesome-ci-${{ github.event.pull_request.head.sha }}-${{ hashFiles('build/package/awesome-ci*') }}
68-
enableCrossOsArchive: true
6952
restore-keys: |
7053
awesome-ci-${{ github.event.pull_request.head.sha }}
7154
72-
#- name: Integration testing
73-
# run: ./tools/test.sh ./out/awesome-ci_${ACI_NEXT_VERSION}_${{ matrix.arch }}
74-
# env:
75-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76-
7755
create_release_test:
7856
runs-on: ubuntu-latest
7957
needs: [generate_infos, build]
8058
steps:
8159
- name: Checkout code
8260
uses: actions/checkout@v3
83-
- name: Setup awesome-ci
84-
uses: fullstack-devops/awesome-ci-action@main
85-
86-
- run: echo "${{ needs.build.steps.test-build-infos.outputs.ACI_PR_BRANCH }}"
8761

8862
- name: get cached build outputs
8963
uses: actions/cache@v3

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ dep_update:
2727
go get -t ./...
2828

2929
awesome-ci: dep
30-
go build ${GOARGS} -tags "${GOTAGS}" -ldflags "${LDFLAGS}" -o ${BUILD_DIR}/package/awesome-ci_${VERSION}_${PLATFORM} ./cmd/awesome-ci
30+
GOOS=linux GOARCH=amd64 go build ${GOARGS} -tags "${GOTAGS}" -ldflags "${LDFLAGS}" -o ${BUILD_DIR}/package/awesome-ci_${VERSION}_amd64 ./cmd/awesome-ci
31+
GOOS=linux GOARCH=arm64 go build ${GOARGS} -tags "${GOTAGS}" -ldflags "${LDFLAGS}" -o ${BUILD_DIR}/package/awesome-ci_${VERSION}_arm64 ./cmd/awesome-ci
32+
GOOS=windows GOARCH=amd64 go build ${GOARGS} -tags "${GOTAGS}" -ldflags "${LDFLAGS}" -o ${BUILD_DIR}/package/awesome-ci_${VERSION}_amd64.exe ./cmd/awesome-ci
33+
GOOS=windows GOARCH=arm64 go build ${GOARGS} -tags "${GOTAGS}" -ldflags "${LDFLAGS}" -o ${BUILD_DIR}/package/awesome-ci_${VERSION}_arm64.exe ./cmd/awesome-ci
3134

32-
#frontend:
33-
#
3435
test: awesome-ci ## Run unittests
3536
go test -short -v ./internal/pkg/...
3637

0 commit comments

Comments
 (0)