Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update version in ci #27

Merged
merged 1 commit into from
May 17, 2023
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
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