Compare commits
57 Commits
2c6a8ac7b0
...
v1.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0650dabb15 | ||
| 42af2d6d25 | |||
| 2dbc72bd39 | |||
| d46a142312 | |||
| caa699c651 | |||
|
|
c5f77582c0 | ||
| 06503ce518 | |||
|
|
f1603dc6fa | ||
| f8932166bb | |||
| ffd41348a0 | |||
|
|
12a9c101f2 | ||
|
|
ff6381575e | ||
|
|
acb4401e37 | ||
| 76d8c1744a | |||
|
|
b2bef77f09 | ||
| 4cbb0666cb | |||
| 83cb34001f | |||
| 1f09482950 | |||
| 1af4d225b5 | |||
| 7863c53280 | |||
|
|
35d888ec62 | ||
|
|
15e317b6fe | ||
| 07f11c7d22 | |||
|
|
7c28081b65 | ||
| d9a75a5e21 | |||
|
|
5da6636dd7 | ||
| b04e653350 | |||
|
|
8469610328 | ||
| 9703682b4a | |||
| e281fbafdb | |||
| be35430727 | |||
| 3667bfae52 | |||
| 8ec9119bc1 | |||
| 4924466a93 | |||
| e37e629630 | |||
| e1db654a48 | |||
| ee19aadac9 | |||
| 17b0d9f72e | |||
| 99a59b47c2 | |||
| 77f83b89f6 | |||
|
|
86d4095444 | ||
|
|
3fd22398d3 | ||
| fcb127ef05 | |||
|
|
4cbadb0f6f | ||
|
|
7ef5780e84 | ||
| 7d37c75d64 | |||
| 31f3df710a | |||
| 709a06ffe6 | |||
|
|
777ed46879 | ||
| 89dedb9870 | |||
| 57d8c1b330 | |||
| 4c1de974f0 | |||
| 452fe85d26 | |||
| 8de631afa2 | |||
|
|
242df40852 | ||
|
|
39d120b6b4 | ||
| 58bb19b43f |
@@ -1,59 +0,0 @@
|
|||||||
name: build and test
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "master"
|
|
||||||
- "develop"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: artifact builds on linux and windows
|
|
||||||
env:
|
|
||||||
RUNNER_TOOL_CACHE: /toolcache
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: setup go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version-file: 'go.mod'
|
|
||||||
- name: setup-dependencies
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
|
||||||
|
|
||||||
- name: get fyne
|
|
||||||
run: |
|
|
||||||
go get fyne.io/fyne/v2@latest
|
|
||||||
go install fyne.io/fyne/v2/cmd/fyne@latest
|
|
||||||
|
|
||||||
- name: go mod
|
|
||||||
run: go mod tidy
|
|
||||||
|
|
||||||
- name: build linux
|
|
||||||
run: |
|
|
||||||
BUILD=${{github.run_number}}
|
|
||||||
GOOS=windows
|
|
||||||
GOARCH=amd64
|
|
||||||
GOFLAGS="-ldflags=-s -ldflags=-w"
|
|
||||||
CGO_ENABLED=1
|
|
||||||
CC=gcc
|
|
||||||
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-linux-amd64 main.go
|
|
||||||
|
|
||||||
- name: build windows
|
|
||||||
run: |
|
|
||||||
BUILD=${{github.run_number}}
|
|
||||||
GOOS=windows
|
|
||||||
GOARCH=amd64
|
|
||||||
GOFLAGS="-ldflags=-H=windowsgui -ldflags=-s -ldflags=-w"
|
|
||||||
CGO_ENABLED=1
|
|
||||||
CC=x86_64-w64-mingw32-gcc
|
|
||||||
fyne package --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-windows-amd64.exe main.go
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: swiped-mod-switcher-${{github.ref_name}}
|
|
||||||
path: bin/
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
name: pull request validation
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: build and run tests
|
|
||||||
env:
|
|
||||||
RUNNER_TOOL_CACHE: /toolcache
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: setup go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version-file: 'go.mod'
|
|
||||||
- name: setup dependencies
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
|
||||||
|
|
||||||
- name: get fyne
|
|
||||||
run: |
|
|
||||||
go get fyne.io/fyne/v2@latest
|
|
||||||
go install fyne.io/fyne/v2/cmd/fyne@latest
|
|
||||||
|
|
||||||
- name: go mod
|
|
||||||
run: go mod tidy
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
run: |
|
|
||||||
GOOS=linux
|
|
||||||
GOARCH=amd64
|
|
||||||
GOFLAGS="-ldflags=-s -ldflags=-w"
|
|
||||||
CGO_ENABLED=1
|
|
||||||
CC=gcc
|
|
||||||
fyne package --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go
|
|
||||||
- name: run tests
|
|
||||||
run: go test -v ./...
|
|
||||||
- name: Check Vet
|
|
||||||
run: go vet ./...
|
|
||||||
- name: check formatting
|
|
||||||
run: |-
|
|
||||||
gofmt -s -l .
|
|
||||||
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
|
|
||||||
- name: check lint
|
|
||||||
uses: golangci/golangci-lint-action@v3
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
118
.gitea/workflows/pull-request-ci.yaml
Normal file
118
.gitea/workflows/pull-request-ci.yaml
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
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: Setup OS dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||||
|
|
||||||
|
- 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: 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
|
||||||
|
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 build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}
|
||||||
|
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 build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe
|
||||||
|
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: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
|
||||||
|
path: bin/
|
||||||
122
.gitea/workflows/push-ci.yaml
Normal file
122
.gitea/workflows/push-ci.yaml
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
name: CI
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master, develop]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: test log
|
||||||
|
run: env | sort
|
||||||
|
|
||||||
|
- name: Setup 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: 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: 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
|
||||||
|
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 build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}
|
||||||
|
ls bin
|
||||||
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: linux
|
||||||
|
GOARCH: amd64
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
CC: gcc
|
||||||
|
|
||||||
|
- name: Build for windows
|
||||||
|
run: |
|
||||||
|
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}-${BUILD}-${GOOS}-${GOARCH}.exe
|
||||||
|
ls bin
|
||||||
|
env:
|
||||||
|
VERSION: ${{github.ref_name}}
|
||||||
|
BUILD: ${{github.run_number}}
|
||||||
|
GOOS: windows
|
||||||
|
GOARCH: amd64
|
||||||
|
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}}-${{github.run_number}}
|
||||||
|
path: bin/
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
name: release-tag
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: setup go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version-file: 'go.mod'
|
|
||||||
- name: setup-dependencies
|
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
|
||||||
|
|
||||||
- name: get fyne
|
|
||||||
run: |
|
|
||||||
go get fyne.io/fyne/v2@latest
|
|
||||||
go install fyne.io/fyne/v2/cmd/fyne@latest
|
|
||||||
|
|
||||||
- name: go mod
|
|
||||||
run: go mod tidy
|
|
||||||
|
|
||||||
- name: build linux
|
|
||||||
run: |
|
|
||||||
VERSION=${{github.ref_name}}
|
|
||||||
BUILD=${{github.run_number}}
|
|
||||||
GOOS=linux
|
|
||||||
GOARCH=amd64
|
|
||||||
GOFLAGS="-ldflags=-s -ldflags=-w"
|
|
||||||
CGO_ENABLED=1
|
|
||||||
CC=gcc
|
|
||||||
fyne package --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go
|
|
||||||
|
|
||||||
- name: build windows
|
|
||||||
run: |
|
|
||||||
VERSION=${{github.ref_name}}
|
|
||||||
BUILD=${{github.run_number}}
|
|
||||||
GOOS=windows
|
|
||||||
GOARCH=amd64
|
|
||||||
GOFLAGS="-ldflags=-H=windowsgui -ldflags=-s -ldflags=-w"
|
|
||||||
CGO_ENABLED=1
|
|
||||||
CC=x86_64-w64-mingw32-gcc
|
|
||||||
fyne package --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/sw1ped-mod-switcher-${VERSION}.${BUILD}-windows-amd64.exe main.go
|
|
||||||
|
|
||||||
- name: add release binaries
|
|
||||||
uses: https://gitea.com/actions/release-action@main
|
|
||||||
with:
|
|
||||||
files: |-
|
|
||||||
bin/**
|
|
||||||
api_key: '${{secrets.RELEASE_TOKEN}}'
|
|
||||||
124
.gitea/workflows/tag-release.yaml
Normal file
124
.gitea/workflows/tag-release.yaml
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
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: Setup OS dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||||
|
|
||||||
|
- 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: 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 build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH}
|
||||||
|
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 build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}-${BUILD}-${GOOS}-${GOARCH}.exe
|
||||||
|
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: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
|
||||||
|
path: bin/
|
||||||
|
|
||||||
|
- name: Release binaries
|
||||||
|
uses: https://gitea.com/actions/release-action@main
|
||||||
|
with:
|
||||||
|
files: |-
|
||||||
|
bin/**
|
||||||
|
api_key: '${{secrets.RELEASE_TOKEN}}'
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
[Details]
|
[Details]
|
||||||
Icon = "icon.png"
|
Icon = "icon.png"
|
||||||
Name = "Swiped Mod Switcher"
|
Name = "Swiped Mod Switcher"
|
||||||
ID = "com.s1d3sw1ped.swipedmodswitcher"
|
ID = "com.s1d3sw1ped.swipedmodswitcher"
|
||||||
Version = "0.0.0"
|
|
||||||
Build = 1
|
|
||||||
|
|||||||
36
main.go
36
main.go
@@ -4,9 +4,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime/debug"
|
||||||
"s1d3sw1ped/swipedmodswitcher/admin"
|
"s1d3sw1ped/swipedmodswitcher/admin"
|
||||||
"slices"
|
"slices"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
@@ -61,16 +61,42 @@ var cfg *Config
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if !admin.Admin() {
|
if !admin.Admin() {
|
||||||
|
fmt.Println("not running as administrator relaunching")
|
||||||
if err := admin.RunSelfElevated(); err != nil {
|
if err := admin.RunSelfElevated(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
return // just incase
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg = loadConfig()
|
cfg = loadConfig()
|
||||||
|
|
||||||
ap := app.New()
|
ap := app.New()
|
||||||
wp := ap.NewWindow(ap.Metadata().Name + " v" + ap.Metadata().Version + "." + strconv.Itoa(ap.Metadata().Build))
|
|
||||||
|
commithash := func() string {
|
||||||
|
if info, ok := debug.ReadBuildInfo(); ok {
|
||||||
|
for _, setting := range info.Settings {
|
||||||
|
if setting.Key == "vcs.revision" {
|
||||||
|
return setting.Value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}()
|
||||||
|
|
||||||
|
buildversion := ap.Metadata().Custom["BuildVersion"]
|
||||||
|
if buildversion == "" {
|
||||||
|
buildversion = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
buildnumber := ap.Metadata().Custom["BuildNumber"]
|
||||||
|
if buildnumber == "" {
|
||||||
|
buildnumber = "commit " + commithash
|
||||||
|
} else {
|
||||||
|
buildnumber = "build " + buildnumber
|
||||||
|
}
|
||||||
|
|
||||||
|
wp := ap.NewWindow(ap.Metadata().Name + " " + buildversion + " " + buildnumber)
|
||||||
wp.Resize(fyne.NewSize(600, 1))
|
wp.Resize(fyne.NewSize(600, 1))
|
||||||
wp.CenterOnScreen()
|
wp.CenterOnScreen()
|
||||||
|
|
||||||
@@ -136,10 +162,14 @@ func fillGrid(grid *fyne.Container, parent fyne.Window) {
|
|||||||
grid.Hide()
|
grid.Hide()
|
||||||
defer grid.Show()
|
defer grid.Show()
|
||||||
grid.RemoveAll()
|
grid.RemoveAll()
|
||||||
|
if admin.Admin() {
|
||||||
for _, profile := range profiles {
|
for _, profile := range profiles {
|
||||||
profilename := filepath.Base(profile)
|
profilename := filepath.Base(profile)
|
||||||
grid.Add(widget.NewButton(profilename, makeIFunc(profile, archive, parent)))
|
grid.Add(widget.NewButton(profilename, makeIFunc(profile, archive, parent)))
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
grid.Add(widget.NewLabel("not running as administrator"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func scanProfiles(profilesroot string) []string {
|
func scanProfiles(profilesroot string) []string {
|
||||||
@@ -181,6 +211,6 @@ func makeIFunc(profile, archive string, parent fyne.Window) func() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.NewInformation("Success", fmt.Sprintf("filinked files from %s to %s", filepath.Base(profile), archive), parent).Show()
|
dialog.NewInformation("Success", fmt.Sprintf("linked files from %s to %s", filepath.Base(profile), archive), parent).Show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user