Skip to content

Commit 68a446c

Browse files
authored
Implement release workflow for building artifacts
Added a new release workflow to build and upload artifacts for multiple platforms.
1 parent c98995a commit 68a446c

1 file changed

Lines changed: 91 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,94 @@ jobs:
4141

4242
- name: Push image to GitHub Container Registry
4343
run: docker push ${{ env.IMAGE_NAME }}:${{ env.VERSION }}
44+
45+
release:
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v4
51+
with:
52+
submodules: true
53+
54+
- name: Set up Go
55+
uses: actions/setup-go@v4
56+
with:
57+
go-version: '1.24.2'
58+
59+
- name: Enable Go Modules and Download Dependencies
60+
run: |
61+
go mod tidy
62+
go mod download
63+
64+
- name: Install protoc
65+
run: |
66+
sudo apt-get update
67+
sudo apt-get install -y protobuf-compiler
68+
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
69+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
70+
echo "$GOPATH/bin" >> $GITHUB_PATH
71+
72+
- name: Install Docker
73+
run: |
74+
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
75+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
76+
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
77+
sudo apt-get update
78+
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
79+
80+
- name: Install Docker Compose
81+
run: |
82+
sudo wget "https://github.com/docker/compose/releases/download/v2.33.1/docker-compose-linux-x86_64" -O /usr/bin/docker-compose
83+
sudo chmod +x /usr/bin/docker-compose
84+
85+
- name: Build and Release
86+
run: make release
87+
88+
- name: Upload artifacts 1
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: StealthIMUser
92+
path: ./bin/StealthIMUser
93+
94+
- name: Upload artifacts 2
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: StealthIMUser.exe
98+
path: ./bin/StealthIMUser.exe
99+
100+
- name: Upload artifacts 3
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: StealthIMUser.docker.zst
104+
path: ./bin/StealthIMUser.docker.zst
105+
set-release:
106+
runs-on: ubuntu-latest
107+
needs: release
108+
permissions:
109+
packages: write
110+
contents: write
111+
112+
steps:
113+
- name: Download File Linux
114+
uses: actions/download-artifact@v4
115+
with:
116+
name: StealthIMUser
117+
118+
- name: Download File Windows
119+
uses: actions/download-artifact@v4
120+
with:
121+
name: StealthIMUser.exe
122+
123+
- name: Download File Docker
124+
uses: actions/download-artifact@v4
125+
with:
126+
name: StealthIMUser.docker.zst
127+
128+
- name: Update Release
129+
uses: softprops/action-gh-release@v2
130+
with:
131+
files: |
132+
StealthIMUser
133+
StealthIMUser.exe
134+
StealthIMUser.docker.zst

0 commit comments

Comments
 (0)