Skip to content

Commit

Permalink
Merge pull request #19 from FloatTech/master
Browse files Browse the repository at this point in the history
[pull] master from FloatTech:master
  • Loading branch information
tang-bai authored Nov 24, 2024
2 parents bab5c4c + 9e8ae43 commit 85ffa64
Show file tree
Hide file tree
Showing 135 changed files with 3,497 additions and 4,406 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: daily
43 changes: 43 additions & 0 deletions .github/workflows/gomod2nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 自动更新 nix 依赖
on:
push:
paths:
- 'go.mod'
- 'go.sum'
- '.github/workflows/gomod2nix.yml'
jobs:
gomod2nix:
name: gomod2nix update
runs-on: ubuntu-latest
steps:
- name: Set up nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Set up Go
uses: actions/setup-go@master
with:
go-version: "1.20"

- name: Check out code into the Go module directory
uses: actions/checkout@master

- name: gomod2nix update
run: |
nix run github:nix-community/gomod2nix
- name: Commit back
if: ${{ !github.head_ref }}
continue-on-error: true
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add --all
git commit -m "chore: bump deps"
- name: Create Pull Request
if: ${{ !github.head_ref }}
continue-on-error: true
uses: peter-evans/create-pull-request@v4
with:
delete-branch: true
branch-suffix: short-commit-hash
42 changes: 42 additions & 0 deletions .github/workflows/nightly-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 打包最新版为 Docker Image

on: [push]
jobs:
docker-builder:
name: build docker
runs-on: ubuntu-23.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@master
- run: sudo apt-get install -y qemu-user-static

- name: Set up nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
sandbox = true
- name: Speed Up nix
uses: DeterminateSystems/magic-nix-cache-action@main

- name: build docker
run: |
mkdir output/
# https://discourse.nixos.org/t/nix-github-actions-aarch64/11034
nix build .#packages.aarch64-linux.docker_builder -o aarch64-linux.docker --print-out-paths --option system aarch64-linux --extra-platforms aarch64-linux
cp $(readlink aarch64-linux.docker) ./output/aarch64-linux.docker.tar.gz
nix build .#packages.x86_64-linux.docker_builder -o x86_64-linux.docker --print-out-paths --option system x86_64-linux --extra-platforms x86_64-linux
cp $(readlink x86_64-linux.docker) ./output/x86_64-linux.docker.tar.gz
# gomod2nix did not provide this
# nix build .#packages.i686-linux.docker_builder -o i686-linux.docker --print-out-paths --option system i686-linux --extra-platforms i686-linux
# cp $(readlink i686-linux.docker) ./output/i686-linux.docker.tar.gz
- name: Upload artifact
uses: actions/upload-artifact@master
if: ${{ !github.head_ref }}
with:
path: output/
5 changes: 4 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
goarch: arm
- goos: windows
goarch: arm64
- goos: windows
goarch: 386
fail-fast: true
steps:
- uses: actions/checkout@master
Expand All @@ -31,6 +33,7 @@ jobs:
go-version: '1.20'
- name: Cache downloaded module
uses: actions/cache@master
continue-on-error: true
with:
path: |
~/.cache/go-build
Expand All @@ -52,4 +55,4 @@ jobs:
if: ${{ !github.head_ref }}
with:
name: ${{ matrix.goos }}_${{ matrix.goarch }}
path: output/
path: output/
7 changes: 6 additions & 1 deletion .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ jobs:
go-version: '1.20'

- name: Check out code into the Go module directory
uses: actions/checkout@master
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Tidy Modules
run: go mod tidy

- name: golangci-lint
uses: golangci/golangci-lint-action@master
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@master

- name: Tidy Modules
run: go mod tidy

- name: Run Lint
uses: golangci/golangci-lint-action@master
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ zerobot
ZeroBot-Plugin*
*.syso
/.direnv
/result
6 changes: 2 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
linters-settings:
errcheck:
ignore: fmt:.*
ignoretests: true

goimports:
Expand Down Expand Up @@ -57,13 +56,12 @@ run:
deadline: 5m
issues-exit-code: 1
tests: false
skip-dirs:
- order
go: '1.20'

# output configuration options
output:
format: "colored-line-number"
formats:
- format: "colored-line-number"
print-issued-lines: true
print-linter-name: true
uniq-by-line: true
Expand Down
1 change: 0 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ builds:
goos:
- windows
goarch:
- 386
- amd64
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
Expand Down
Loading

0 comments on commit 85ffa64

Please sign in to comment.