+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
4 changes: 4 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changelog:
exclude:
labels:
- tagpr
16 changes: 16 additions & 0 deletions .github/workflows/tagpr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# .github/workflows/tagpr.yml
name: tagpr
on:
push:
branches: ["main"]
jobs:
deploy:
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4.2.2
- uses: Songmu/tagpr@v1.5.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions .github/workflows/testandvet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test and Vet

on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
- created
- edited

defaults:
run:
shell: bash

jobs:
test:
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: 'go.mod'

- name: Cache Go module and build cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
key: go-${{ hashFiles('**/go.sum') }}
path: |
~/go/pkg/mod
restore-keys: |
go-

- name: Install tennvet
run: |
GOBIN=$(pwd) go install github.com/tenntenn/tennvet@latest

- name: Test and vet
run: |
go vet ./...
go vet -vettool=$(pwd)/tennvet ./...
go test -v -race ./...
35 changes: 35 additions & 0 deletions .tagpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# config file for the tagpr in git config format
# The tagpr generates the initial configuration, which you can rewrite to suit your environment.
# CONFIGURATIONS:
# tagpr.releaseBranch
# Generally, it is "main." It is the branch for releases. The pcpr tracks this branch,
# creates or updates a pull request as a release candidate, or tags when they are merged.
#
# tagpr.versionFile
# Versioning file containing the semantic version needed to be updated at release.
# It will be synchronized with the "git tag".
# Often this is a meta-information file such as gemspec, setup.cfg, package.json, etc.
# Sometimes the source code file, such as version.go or Bar.pm, is used.
# If you do not want to use versioning files but only git tags, specify the "-" string here.
# You can specify multiple version files by comma separated strings.
#
# tagpr.vPrefix
# Flag whether or not v-prefix is added to semver when git tagging. (e.g. v1.2.3 if true)
# This is only a tagging convention, not how it is described in the version file.
#
# tagpr.changelog (Optional)
# Flag whether or not changelog is added or changed during the release.
#
# tagpr.command (Optional)
# Command to change files just before release.
#
# tagpr.tmplate (Optional)
# Pull request template in go template format
#
# tagpr.release (Optional)
# GitHub Release creation behavior after tagging [true, draft, false]
# If this value is not set, the release is to be created.
[tagpr]
vPrefix = true
releaseBranch = main
versionFile = version.txt
9 changes: 6 additions & 3 deletions version.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
package main

import (
_ "embed"
"fmt"
"os"
"runtime"
"strings"
)

// version of zagane
const version = "v0.5.2"
//go:embed version.txt
var version string

// print version of zagane
func printVersion() bool {
if len(os.Args) != 2 {
return false
}

switch os.Args[1] {
case "-v", "--version":
fmt.Printf("zagane %s (%s)\n", version, runtime.Version())
fmt.Printf("zagane %s (%s)\n", strings.TrimSpace(version), runtime.Version())
return true
}

Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.5.2
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载