Skip to content

Commit 5b5fb63

Browse files
Update CI
1 parent 9fc9d65 commit 5b5fb63

File tree

5 files changed

+71
-48
lines changed

5 files changed

+71
-48
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,60 @@
11
name: Build (Multiple Arch)
22

33
on:
4-
push:
5-
branches: [ develop ]
4+
push:
5+
branches: [ develop ]
6+
pull_request:
7+
branches: [ develop ]
8+
workflow_dispatch:
69

710
jobs:
8-
GoBuild:
9-
runs-on: ubuntu-latest
10-
11-
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
14-
15-
- name: Run Makefile
16-
run: make
17-
18-
- name: Upload win64
19-
uses: actions/upload-artifact@v4
20-
with:
21-
name: win64
22-
path: build/chibi_x64_win.exe
23-
24-
- name: Upload Apple Silicon
25-
uses: actions/upload-artifact@v4
26-
with:
27-
name: apple_silicon
28-
path: build/chibi_darwin_silicon
29-
30-
- name: Upload Apple Intel
31-
uses: actions/upload-artifact@v4
32-
with:
33-
name: apple_intel
34-
path: build/chibi_darwin_intel
35-
36-
- name: Upload Debian
37-
uses: actions/upload-artifact@v4
38-
with:
39-
name: debian
40-
path: build/chibi_debian.deb
41-
42-
- name: Upload Linux
43-
uses: actions/upload-artifact@v4
44-
with:
45-
name: linux
46-
path: build/chibi_x64_linux
11+
build:
12+
if: github.event_name == 'push' || github.event_name == 'pull_request'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Run Make
19+
run: make
20+
21+
- name: Upload Artifacts
22+
uses: actions/upload-artifact@v4
23+
with:
24+
name: build
25+
path: build/*
26+
27+
create_release:
28+
if: github.event_name == 'workflow_dispatch'
29+
runs-on: ubuntu-latest
30+
needs: build
31+
32+
steps:
33+
- name: Download artifacts
34+
uses: actions/download-artifact@v4
35+
with:
36+
name: download-artifacts
37+
38+
- name: Read Version
39+
id: read_version
40+
run: |
41+
VERSION=$(cat version.txt)
42+
echo "Current version: $VERSION"
43+
echo "version=$VERSION" >> $GITHUB_ENV
44+
45+
- name: Create Release
46+
id: create-release
47+
uses: comnoco/[email protected]
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
tag_name: ${{ env.version }}
52+
release_name: Version ${{ env.version }} 🔖
53+
body: $(cat CHANGELOG.md)
54+
draft: false
55+
prerelease: false
56+
57+
- name: Upload Artifacts to Release
58+
uses: alexellis/[email protected]
59+
with:
60+
asset_paths: '[ "build/*" ]'

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed some PRs

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
VERSION=1.0
1+
VERSION=1.0.0
22
BINARY_NAME=chibi
33
BUILD_DIR=build
44
DEB_PATH=chibi_debian
55
LDFLAGS="-s -w"
6+
VERSION := $(shell cat version.txt)
67

7-
LINUX_BIN=${BINARY_NAME}_x64_linux
8-
WIN_BIN=${BINARY_NAME}_x64_win
9-
APPLE_INTEL_BIN=${BINARY_NAME}_darwin_intel
10-
APPLE_SILICON_BIN=${BINARY_NAME}_darwin_silicon
8+
LINUX_BIN=${BINARY_NAME}_linux_amd64
9+
WIN_BIN=${BINARY_NAME}_windows_amd64.exe
10+
APPLE_INTEL_BIN=${BINARY_NAME}_darwin_amd64
11+
APPLE_SILICON_BIN=${BINARY_NAME}_darwin_arm64
1112

1213
.PHONY: all
1314

@@ -21,7 +22,7 @@ compile:
2122
go mod tidy
2223
GOARCH=amd64 GOOS=darwin go build -ldflags=${LDFLAGS} -v -o ${BUILD_DIR}/${APPLE_INTEL_BIN}
2324
GOARCH=arm64 GOOS=darwin go build -ldflags=${LDFLAGS} -v -o ${BUILD_DIR}/${APPLE_SILICON_BIN}
24-
GOARCH=amd64 GOOS=windows go build -ldflags=${LDFLAGS} -v -o ${BUILD_DIR}/${WIN_BIN}.exe
25+
GOARCH=amd64 GOOS=windows go build -ldflags=${LDFLAGS} -v -o ${BUILD_DIR}/${WIN_BIN}
2526
GOARCH=amd64 GOOS=linux go build -ldflags=${LDFLAGS} -v -o ${BUILD_DIR}/${LINUX_BIN}
2627

2728
pack_deb:
@@ -42,6 +43,6 @@ pack_deb:
4243
@echo "Homepage: https://github.com/CosmicPredator/chibi-cli" >> ${DEB_PATH}/DEBIAN/control
4344

4445
dpkg-deb --build ${DEB_PATH}
45-
mv chibi_debian.deb ${BUILD_DIR}/chibi_debian.deb
46+
mv chibi_debian.deb ${BUILD_DIR}/chibi_${VERSION}_amd64.deb
4647

4748
rm -rf ${DEB_PATH}/

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ This section provides the quickest way to get started with chibi-cli. For detail
4545
## Documentation
4646
WIP 😁
4747
48+
## Contributing
49+
Contributions are heartily welcomed...!
50+
51+
Please refer to the [pull request guide](https://github.com/CosmicPredator/chibi-cli/blob/develop/.github/PULL_REQUEST_TEMPLATE.md)
52+
before creating a pull request.
53+
4854
## Special Thanks
4955
This project is not possible without the following libraries,
5056

version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0

0 commit comments

Comments
 (0)