Skip to content

Commit

Permalink
hs
Browse files Browse the repository at this point in the history
  • Loading branch information
shoce committed Sep 6, 2023
0 parents commit 97f6e9e
Show file tree
Hide file tree
Showing 6 changed files with 1,088 additions and 0 deletions.
134 changes: 134 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# https://docs.github.com/en/actions/learn-github-actions/contexts
name: release
permissions:
contents: write
on:
push:
branches: [ "main" ]
jobs:

build-push-ubuntu-22-04:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: version
run: |
BUILD_OS=ubuntu-22.04
echo "BUILD_OS:$BUILD_OS"
echo "BUILD_OS=$BUILD_OS" >> $GITHUB_ENV
VERSION=$( date '+%y%m%d.%H%M.0' )-$BUILD_OS
echo "VERSION:$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- uses: actions/setup-go@v4
with:
go-version: '^1.21.0'
- name: go build
run: GOOS=linux GOARCH=amd64 go build -o ${{ github.event.repository.name }}.linux.amd64 -trimpath -ldflags ' -X main.Version='$VERSION
- name: gzip
run: gzip -k ${{ github.event.repository.name }}.linux.amd64
- name: list files
run: ls -l -a
- name: release notes
run: |
{
echo "curl -sSL https://github.com/shoce/${{ github.event.repository.name }}/releases/download/$VERSION/${{ github.event.repository.name }}.linux.amd64.gz | gunzip | put /bin/${{ github.event.repository.name }}-$BUILD_OS 755"
echo "curl -sSL https://github.com/shoce/${{ github.event.repository.name }}/releases/download/$VERSION/${{ github.event.repository.name }}.linux.amd64.gz | gunzip | put /bin/${{ github.event.repository.name }} 755"
echo
echo /etc/os-release:
cat /etc/os-release
echo
echo go version:
go version
} >release.notes..text
- name: gh release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: gh release create $VERSION ${{ github.event.repository.name }}.linux.amd64.gz --notes-file release.notes..text

build-push-ubuntu-20-04:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: version
run: |
BUILD_OS=ubuntu-20.04
echo "BUILD_OS:$BUILD_OS"
echo "BUILD_OS=$BUILD_OS" >> $GITHUB_ENV
VERSION=$( date '+%y%m%d.%H%M.0' )-$BUILD_OS
echo "VERSION:$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- uses: actions/setup-go@v4
with:
go-version: '^1.21.0'
- name: go build
run: GOOS=linux GOARCH=amd64 go build -o ${{ github.event.repository.name }}.linux.amd64 -trimpath -ldflags ' -X main.Version='$VERSION
- name: gzip
run: gzip -k ${{ github.event.repository.name }}.linux.amd64
- name: list files
run: ls -l -a
- name: release notes
run: |
{
echo "curl -sSL https://github.com/shoce/${{ github.event.repository.name }}/releases/download/$VERSION/${{ github.event.repository.name }}.linux.amd64.gz | gunzip | put /bin/${{ github.event.repository.name }}-$BUILD_OS 755"
echo "curl -sSL https://github.com/shoce/${{ github.event.repository.name }}/releases/download/$VERSION/${{ github.event.repository.name }}.linux.amd64.gz | gunzip | put /bin/${{ github.event.repository.name }} 755"
echo
echo /etc/os-release:
cat /etc/os-release
echo
echo go version:
go version
} >release.notes..text
- name: gh release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: gh release create $VERSION ${{ github.event.repository.name }}.linux.amd64.gz --notes-file release.notes..text

build-push-alpine-3-18:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# https://github.com/jirutka/setup-alpine
- uses: jirutka/setup-alpine@v1
with:
branch: v3.18
arch: x86_64
packages: >
go
- name: version
run: |
BUILD_OS=alpine-3.18
echo "BUILD_OS:$BUILD_OS"
echo "BUILD_OS=$BUILD_OS" >> $GITHUB_ENV
VERSION=$( date '+%y%m%d.%H%M.0' )-$BUILD_OS
echo "VERSION:$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: go build
shell: alpine.sh {0}
run: GOOS=linux GOARCH=amd64 go build -o ${{ github.event.repository.name }}.linux.amd64 -trimpath -ldflags ' -X main.Version='$VERSION
- name: gzip
shell: alpine.sh {0}
run: gzip -k ${{ github.event.repository.name }}.linux.amd64
- name: list files
shell: alpine.sh {0}
run: ls -l -a
- name: release notes
shell: alpine.sh {0}
run: |
{
echo "curl -sSL https://github.com/shoce/${{ github.event.repository.name }}/releases/download/$VERSION/${{ github.event.repository.name }}.linux.amd64.gz | gunzip | put /bin/${{ github.event.repository.name }}-$BUILD_OS 755"
echo "curl -sSL https://github.com/shoce/${{ github.event.repository.name }}/releases/download/$VERSION/${{ github.event.repository.name }}.linux.amd64.gz | gunzip | put /bin/${{ github.event.repository.name }} 755"
echo
echo /etc/alpine-release:
cat /etc/alpine-release
echo
echo go version:
go version
} >release.notes..text
- name: gh release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: gh release create $VERSION ${{ github.event.repository.name }}.linux.amd64.gz --notes-file release.notes..text

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.DS_Store

23 changes: 23 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module github.com/shoce/hs

go 1.21

require (
github.com/ipfs/go-cid v0.4.1
github.com/multiformats/go-multihash v0.2.3
golang.org/x/crypto v0.13.0
golang.org/x/net v0.15.0
)

require (
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
golang.org/x/sys v0.12.0 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
)
31 changes: 31 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE=
github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI=
github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0=
github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4=
github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g=
github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk=
github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U=
github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM=
github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8=
github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI=
lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=
Loading

0 comments on commit 97f6e9e

Please sign in to comment.