Skip to content

Commit

Permalink
Create build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
SuInk authored Feb 15, 2023
1 parent 441994f commit c35d13e
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
push:
tags:
- '**'

jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: build and pack
run: |
go build main.go
mkdir files
mv main files/qq-chatgpt-bot-linux64
cd files
mkdir go-cqhttp
wget https://github.com/Mrs4s/go-cqhttp/releases/download/v1.0.0-rc4/go-cqhttp_linux_amd64.tar.gz -O go-cqhttp/go-cqhttp_linux_amd64.tar.gz
tar -zxvf go-cqhttp/go-cqhttp_linux_amd64.tar.gz -C go-cqhttp
rm go-cqhttp/go-cqhttp_linux_amd64.tar.gz
cd ..
tar -cvf files/qq-chatgpt-bot-linux64.tar.gz files/qq-chatgpt-bot-linux64 files/go-cqhttp
- name: Upload compressed files to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: files/qq-chatgpt-bot-linux64.tar.gz
asset_name: qq-chatgpt-bot-linux64.tar.gz
overwrite: true

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Build && pack
run: |
go build main.go
mkdir files
mv main.exe files/qq-chatgpt-bot.exe
cd files
mkdir go-cqhttp
wget https://github.com/Mrs4s/go-cqhttp/releases/download/v1.0.0-rc4/go-cqhttp_windows_amd64.exe -O files/go-cqhttp/go-cqhttp_windows_amd64.exe
cd ..
zip -r files/qq-chatgpt-bot-windows-amd64.zip go-cqhttp files/qq-chatgpt-bot.exe
- name: Upload compressed files to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: files/qq-chatgpt-bot-windows-amd64.zip
asset_name: qq-chatgpt-bot-windows-amd64.zip
overwrite: true

0 comments on commit c35d13e

Please sign in to comment.