7 Commits

5 changed files with 30 additions and 39 deletions

View File

@@ -1,29 +0,0 @@
kind: pipeline
type: docker
name: default
node:
region: cn
steps:
- name: generate
pull: if-not-exists
image: ccr.ccs.tencentyun.com/xiaoqidun/build
commands:
- build -f build.sh -i ihash.go -o release/ihash
- name: build
pull: if-not-exists
image: ccr.ccs.tencentyun.com/xiaoqidun/goenv
commands:
- ./build.sh
- name: upload
pull: if-not-exists
image: ccr.ccs.tencentyun.com/xiaoqidun/gocos
settings:
secret_id:
from_secret: cos_secret_id
secret_key:
from_secret: cos_secret_key
bucket_url:
from_secret: cos_bucket_url
source: release/
target: product/ihash
strip_prefix: release/

View File

@@ -0,0 +1,28 @@
on: [push, workflow_dispatch]
jobs:
build:
runs-on: cn
steps:
- name: checkout
uses: actions/checkout@v6
- name: generate
uses: docker://ccr.ccs.tencentyun.com/xiaoqidun/build:latest
with:
args: -f build.sh -i ihash.go -o release/ihash
- name: docker goenv
uses: docker://ccr.ccs.tencentyun.com/xiaoqidun/goenv:latest
env:
GIT_SERVER: ${{ secrets.git_server }}
GIT_USER: ${{ secrets.git_user }}
GIT_TOKEN: ${{ secrets.git_token }}
with:
args: bash build.sh
- name: upload to cos
uses: docker://ccr.ccs.tencentyun.com/xiaoqidun/gocos
env:
PLUGIN_SECRET_ID: ${{secrets.cos_secret_id}}
PLUGIN_SECRET_KEY: ${{secrets.cos_secret_key}}
PLUGIN_BUCKET_URL: ${{secrets.cos_bucket_url}}
PLUGIN_SOURCE: release/
PLUGIN_TARGET: product/ihash
PLUGIN_STRIP_PREFIX: release/

6
go.mod
View File

@@ -1,7 +1,3 @@
module github.com/xiaoqidun/ihash
go 1.22.2
require golang.org/x/crypto v0.23.0
require golang.org/x/sys v0.20.0 // indirect
go 1.25.4

4
go.sum
View File

@@ -1,4 +0,0 @@
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=

View File

@@ -5,10 +5,10 @@ import (
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
"crypto/sha3"
"crypto/sha512"
"flag"
"fmt"
"golang.org/x/crypto/sha3"
"hash"
"io"
"io/ioutil"