added CI
This commit is contained in:
91
.gitea/workflows/pull-request-ci.yaml
Normal file
91
.gitea/workflows/pull-request-ci.yaml
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
name: CI
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Install go dependencies
|
||||||
|
run: go mod tidy
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
uses: golangci/golangci-lint-action@v3
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Get go dependencies
|
||||||
|
run: |
|
||||||
|
go mod tidy
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -race -v -shuffle=on ./...
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Get go dependencies
|
||||||
|
run: |
|
||||||
|
go mod tidy
|
||||||
|
|
||||||
|
- name: Build for linux
|
||||||
|
run: |
|
||||||
|
go build -o bin/SteamCache2-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe main.go
|
||||||
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: linux
|
||||||
|
GOARCH: amd64
|
||||||
|
EXE: ""
|
||||||
|
|
||||||
|
- name: Build for windows
|
||||||
|
run: |
|
||||||
|
go build -o bin/SteamCache2-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe main.go
|
||||||
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: windows
|
||||||
|
GOARCH: amd64
|
||||||
|
EXE: ".exe"
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: SteamCache2-${{github.ref_name}}-${{github.run_number}}
|
||||||
|
path: bin/
|
||||||
90
.gitea/workflows/push-ci.yaml
Normal file
90
.gitea/workflows/push-ci.yaml
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
name: CI
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, develop]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Install go dependencies
|
||||||
|
run: go mod tidy
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
uses: golangci/golangci-lint-action@v3
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Get go dependencies
|
||||||
|
run: |
|
||||||
|
go mod tidy
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -race -v -shuffle=on ./...
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Get go dependencies
|
||||||
|
run: |
|
||||||
|
go mod tidy
|
||||||
|
|
||||||
|
- name: Build for linux
|
||||||
|
run: |
|
||||||
|
go build -o bin/SteamCache2-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe main.go
|
||||||
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: linux
|
||||||
|
GOARCH: amd64
|
||||||
|
|
||||||
|
- name: Build for windows
|
||||||
|
run: |
|
||||||
|
go build -o bin/SteamCache2-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe main.go
|
||||||
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: windows
|
||||||
|
GOARCH: amd64
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: SteamCache2-${{github.ref_name}}-${{github.run_number}}
|
||||||
|
path: bin/
|
||||||
93
.gitea/workflows/tag-release.yaml
Normal file
93
.gitea/workflows/tag-release.yaml
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
name: Release versioned tag
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Install go dependencies
|
||||||
|
run: go mod tidy
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
uses: golangci/golangci-lint-action@v3
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Get go dependencies
|
||||||
|
run: |
|
||||||
|
go mod tidy
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -race -v -shuffle=on ./...
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Build versioned release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Install go dependencies
|
||||||
|
run: go mod tidy
|
||||||
|
|
||||||
|
- name: Build for linux
|
||||||
|
run: |
|
||||||
|
go build -o bin/SteamCache2-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH} main.go
|
||||||
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: linux
|
||||||
|
GOARCH: amd64
|
||||||
|
EXE: ""
|
||||||
|
|
||||||
|
- name: Build for windows
|
||||||
|
run: |
|
||||||
|
go build -o bin/SteamCache2-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH} main.go
|
||||||
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: windows
|
||||||
|
GOARCH: amd64
|
||||||
|
EXE: ".exe"
|
||||||
|
|
||||||
|
- name: Release binaries
|
||||||
|
uses: https://gitea.com/actions/release-action@main
|
||||||
|
with:
|
||||||
|
files: |-
|
||||||
|
bin/**
|
||||||
|
api_key: '${{secrets.RELEASE_TOKEN}}'
|
||||||
Reference in New Issue
Block a user