Compare commits
5 Commits
777ed46879
...
4cbadb0f6f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4cbadb0f6f | ||
|
|
7ef5780e84 | ||
| 7d37c75d64 | |||
| 31f3df710a | |||
| 709a06ffe6 |
117
.gitea/workflows/pull-request-ci.yaml
Normal file
117
.gitea/workflows/pull-request-ci.yaml
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
name: CI
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
|
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
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
|
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: Setup OS dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||||
|
|
||||||
|
- name: Get fyne command
|
||||||
|
run: |
|
||||||
|
go install fyne.io/fyne/v2/cmd/fyne@latest
|
||||||
|
|
||||||
|
- name: Get go dependencies
|
||||||
|
run: |
|
||||||
|
go mod tidy
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -race -v -shuffle=on ./...
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
|
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: Setup OS dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||||
|
|
||||||
|
- name: Get fyne command
|
||||||
|
run: |
|
||||||
|
go install fyne.io/fyne/v2/cmd/fyne@latest
|
||||||
|
|
||||||
|
- name: Get go dependencies
|
||||||
|
run: |
|
||||||
|
go mod tidy
|
||||||
|
|
||||||
|
- name: Build for linux
|
||||||
|
run: |
|
||||||
|
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go
|
||||||
|
env:
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: linux
|
||||||
|
GOARCH: amd64
|
||||||
|
EXE: ""
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
CC: gcc
|
||||||
|
|
||||||
|
- name: Build for windows
|
||||||
|
run: |
|
||||||
|
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go
|
||||||
|
env:
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: windows
|
||||||
|
GOARCH: amd64
|
||||||
|
EXE: .exe
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
CC: x86_64-w64-mingw32-gcc
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: swiped-mod-switcher-${{github.ref_name}}
|
||||||
|
path: bin/
|
||||||
@@ -2,18 +2,10 @@ name: CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master, develop]
|
branches: [master, develop]
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
permissions:
|
|
||||||
# Required: allow read access to the content for analysis.
|
|
||||||
contents: read
|
|
||||||
# Optional: allow read access to pull request. Use with `only-new-issues` option.
|
|
||||||
pull-requests: read
|
|
||||||
# Optional: Allow write access to checks to allow the action to annotate code in the PR.
|
|
||||||
checks: write
|
|
||||||
env:
|
env:
|
||||||
RUNNER_TOOL_CACHE: /toolcache
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -28,11 +20,13 @@ jobs:
|
|||||||
check-latest: true
|
check-latest: true
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
|
- name: Install go dependencies
|
||||||
|
run: go mod tidy
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@v3
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: --verbose
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
@@ -99,6 +93,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go
|
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go
|
||||||
env:
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
BUILD: ${{github.run_number}}
|
BUILD: ${{github.run_number}}
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
@@ -110,6 +105,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go
|
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}${EXE} main.go
|
||||||
env:
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
BUILD: ${{github.run_number}}
|
BUILD: ${{github.run_number}}
|
||||||
GOOS: windows
|
GOOS: windows
|
||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
name: Release versioned tag
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
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'
|
|
||||||
|
|
||||||
- name: Setup OS dependencies
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
|
||||||
|
|
||||||
- name: Install fyne command
|
|
||||||
run: |
|
|
||||||
go install fyne.io/fyne/v2/cmd/fyne@latest
|
|
||||||
|
|
||||||
- name: Install go dependencies
|
|
||||||
run: go mod tidy
|
|
||||||
|
|
||||||
- name: Build for linux
|
|
||||||
run: |
|
|
||||||
VERSION=${{github.ref_name}}
|
|
||||||
BUILD=${{github.run_number}}
|
|
||||||
GOFLAGS="-ldflags=-s -ldflags=-w"
|
|
||||||
CGO_ENABLED=1
|
|
||||||
CC=gcc
|
|
||||||
fyne package --os linux --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go
|
|
||||||
|
|
||||||
- name: Build for windows
|
|
||||||
run: |
|
|
||||||
VERSION=${{github.ref_name}}
|
|
||||||
BUILD=${{github.run_number}}
|
|
||||||
GOFLAGS="-ldflags=-H=windowsgui -ldflags=-s -ldflags=-w"
|
|
||||||
CGO_ENABLED=1
|
|
||||||
CC=x86_64-w64-mingw32-gcc
|
|
||||||
fyne package --os windows --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-windows-amd64.exe main.go
|
|
||||||
|
|
||||||
- name: Release binaries
|
|
||||||
uses: https://gitea.com/actions/release-action@main
|
|
||||||
with:
|
|
||||||
files: |-
|
|
||||||
bin/**
|
|
||||||
api_key: '${{secrets.RELEASE_TOKEN}}'
|
|
||||||
119
.gitea/workflows/tag-release.yaml
Normal file
119
.gitea/workflows/tag-release.yaml
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
name: Release versioned tag
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
|
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
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
|
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: Setup OS dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||||
|
|
||||||
|
- name: Get fyne command
|
||||||
|
run: |
|
||||||
|
go install fyne.io/fyne/v2/cmd/fyne@latest
|
||||||
|
|
||||||
|
- 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'
|
||||||
|
|
||||||
|
- name: Setup OS dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||||
|
|
||||||
|
- name: Install fyne command
|
||||||
|
run: |
|
||||||
|
go install fyne.io/fyne/v2/cmd/fyne@latest
|
||||||
|
|
||||||
|
- name: Install go dependencies
|
||||||
|
run: go mod tidy
|
||||||
|
|
||||||
|
- name: Build for linux
|
||||||
|
run: |
|
||||||
|
fyne package --os linux --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-linux-amd64 main.go
|
||||||
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: linux
|
||||||
|
GOARCH: amd64
|
||||||
|
EXE: ""
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
CC: gcc
|
||||||
|
|
||||||
|
|
||||||
|
- name: Build for windows
|
||||||
|
run: |
|
||||||
|
fyne package --os windows --release --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION#v}.${BUILD}-windows-amd64.exe main.go
|
||||||
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: windows
|
||||||
|
GOARCH: amd64
|
||||||
|
EXE: ".exe"
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
CC: x86_64-w64-mingw32-gcc
|
||||||
|
|
||||||
|
|
||||||
|
- 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