This commit is contained in:
@@ -1,30 +1,29 @@
|
|||||||
name: Build Go Project
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["master"]
|
branches: ["master"]
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: "1.22"
|
go-version: "1.22"
|
||||||
|
|
||||||
- name: Download dependencies
|
- name: Build
|
||||||
run: go mod download
|
run: |
|
||||||
|
go mod download
|
||||||
|
go build -o Sneedchat-Discord-Bridge .
|
||||||
|
|
||||||
- name: Build binary
|
- name: Archive build artifact
|
||||||
run: go build -o Sneedchat-Discord-Bridge .
|
|
||||||
|
|
||||||
- name: Upload build artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: Sneedchat-Discord-Bridge
|
name: sneedchatdiscordbridge
|
||||||
path: Sneedchat-Discord-Bridge
|
path: Sneedchat-Discord-Bridge
|
||||||
|
|||||||
@@ -8,34 +8,33 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Setup Go
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: "1.22"
|
go-version: '1.22'
|
||||||
|
|
||||||
- name: Build cross-platform binaries
|
- name: Build binaries
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
GOOS=linux GOARCH=amd64 go build -o dist/sneedchat-bridge-linux-amd64 .
|
GOOS=linux GOARCH=amd64 go build -o dist/sneedchat-bridge-linux-amd64 .
|
||||||
GOOS=linux GOARCH=arm64 go build -o dist/sneedchat-bridge-linux-arm64 .
|
GOOS=linux GOARCH=arm64 go build -o dist/sneedchat-bridge-linux-arm64 .
|
||||||
GOOS=windows GOARCH=amd64 go build -o dist/sneedchat-bridge-windows-amd64.exe .
|
GOOS=windows GOARCH=amd64 go build -o dist/sneedchat-bridge-windows-amd64.exe .
|
||||||
GOOS=darwin GOARCH=amd64 go build -o dist/sneedchat-bridge-macos-amd64 .
|
GOOS=darwin GOARCH=amd64 go build -o dist/sneedchat-bridge-macos-amd64 .
|
||||||
GOOS=darwin GOARCH=arm64 go build -o dist/sneedchat-bridge-macos-arm64 .
|
GOOS=darwin GOARCH=arm64 go build -o dist/sneedchat-bridge-macos-arm64 .
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Release
|
||||||
uses: https://gitea.com/actions/release-action@v1
|
uses: https://gitea.com/actions/release-action@v1
|
||||||
with:
|
with:
|
||||||
api_key: ${{ secrets.GITEA_TOKEN }}
|
api_key: ${{ secrets.CI_TOKEN }}
|
||||||
owner: Salastil
|
owner: Salastil
|
||||||
repo: Sneedchat-Discord-Bridge-Go
|
repo: Sneedchat-Discord-Bridge-Go
|
||||||
tag: ${{ github.ref_name }}
|
tag: ${{ github.ref_name }}
|
||||||
name: "Release ${{ github.ref_name }}"
|
name: Release ${{ github.ref_name }}
|
||||||
prerelease: false
|
|
||||||
draft: false
|
draft: false
|
||||||
files: |
|
prerelease: false
|
||||||
dist/*
|
files: dist/*
|
||||||
|
|||||||
Reference in New Issue
Block a user