Skip to content

Commit

Permalink
Merge pull request #27 from zema1/release-ci-version
Browse files Browse the repository at this point in the history
feat: update version in ci
  • Loading branch information
zema1 authored May 17, 2023
2 parents fea7f28 + 7ac555f commit 70bc600
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release suo5
on:
push:
branches:
- 'release/**'
- 'release**'
- 'main'
release:
types: [ published ]
Expand All @@ -12,16 +12,8 @@ permissions:
contents: read

jobs:
prepare:
name: Prepare release environment
runs-on: ubuntu-latest
steps:
- run: env
# - run: node version.js ${{ github.event.release.tag_name }} https://github.com/marcus-crane/october/blob/main/version.js

build-binary:
name: Build cli
needs: prepare
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -54,15 +46,14 @@ jobs:
with:
go-version: 1.19
cache: true
- run: go build -trimpath -ldflags "-w -s -extldflags '-static'" -o target/${{ matrix.output }}
- run: go build -trimpath -ldflags "-w -s -extldflags '-static' -X main.Version=${{ github.ref_name }}" -o target/${{ matrix.output }}
- uses: actions/upload-artifact@v3
with:
name: target
path: target/*

build-gui:
name: Build gui
needs: prepare
strategy:
fail-fast: false
matrix:
Expand All @@ -86,6 +77,10 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 16
- name: Bump manifest version
if: startsWith(github.ref, 'refs/tags/')
working-directory: gui
run: node version.js ${{ github.ref_name }}
- run: npm install && npm run build
working-directory: gui/frontend
- uses: dAppServer/wails-build-action@v2
Expand Down
14 changes: 14 additions & 0 deletions gui/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const fs = require("fs")
const manifest = require("./wails.json")
const version = process.argv[2].replace("v", "").split("-")[0]

if (!version) {
console.log("No version supplied")
process.exit(1)
}

manifest.info.productVersion = version

const data = JSON.stringify(manifest, null, 2)
fs.writeFileSync("wails.json", data)
console.log(`Updated build version to ${version}`)
2 changes: 1 addition & 1 deletion gui/wails.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"info": {
"companyName": "",
"productName": "suo5-gui",
"productVersion": "0.6.0",
"productVersion": "0.0.0",
"copyright": "All rights reserved",
"comments": "Built using Wails (https://wails.app)"
}
Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import (
"strings"
)

var Version = "v0.0.0"

func main() {
log.Default.SetTimeFormat("01-02 15:04")
app := cli.NewApp()
app.Name = "suo5"
app.Usage = "A super http proxy tunnel"
app.Version = "v0.6.0"
app.Version = Version

defaultConfig := ctrl.DefaultSuo5Config()

Expand Down

0 comments on commit 70bc600

Please sign in to comment.