Skip to content

Commit

Permalink
feat: GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ystyle committed Sep 14, 2022
1 parent 2de382b commit cf0b58f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Go

on:
release:
types: [published]

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.19
id: go

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

- name: Build
run: |
hash=`git rev-list --tags --max-count=1`
version=`git describe --tags $hash`
flag="-s -w -X main.version=$version"
go mod tidy
GOOS=windows GOARCH=amd64 go build -ldflags "$flag" -o build/windows-amd64/jvms.exe
GOOS=windows GOARCH=386 go build -ldflags "$flag" -o build/windows-386/jvms.exe
- name: compression zip
run: |
hash=`git rev-list --tags --max-count=1`
version=`git describe --tags $hash`
zip -j jvms_${version}_amd64.zip build/windows-amd64/jvms.exe
zip -j jvms_${version}_386.zip build/windows-386/jvms.exe
- name: Upload release binaries
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./jvms_*.zip"]'
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import (
"path"
)

var version = "2.1.0"

const (
version = "2.1.0"
defaultOriginalpath = "https://raw.githubusercontent.com/ystyle/jvms/new/jdkdlindex.json"
)

Expand Down

0 comments on commit cf0b58f

Please sign in to comment.