From c3aeb044376b8d78cd6e74f6af3522fb068f7a6e Mon Sep 17 00:00:00 2001 From: mJehanno Date: Mon, 15 Apr 2024 08:04:55 +0200 Subject: [PATCH] feat(minus): add a game that handle substraction --- .github/workflows/build.yml | 2 +- .goreleaser.yaml | 50 +++++++++++++++++++++++++++++++++++++ Taskfile.yml | 6 ++++- frontend/package.json | 2 +- frontend/src/pages/Game.vue | 6 +---- frontend/src/stores/game.ts | 6 +++++ main.go | 2 +- wails.json | 2 +- 8 files changed, 66 insertions(+), 10 deletions(-) create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fac3b9a..285bc81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: 'mult-game_linux-amd64' platform: 'linux/amd64' os: 'ubuntu-latest' - - name: 'mult-game_windows-amd64' + - name: 'mult-game_windows-amd64.exe' platform: 'windows/amd64' os: 'windows-latest' diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..237624d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,50 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 1 + +before: + hooks: + - go mod tidy + - task build:front + +builds: + - goos: + #- CGO_ENABLED=1 + + - linux + #- windows + #- darwin + goarch: + - "amd64" + ldflags: -w -s -H windowsgui + flags: + - -tags="desktop production" + - -o=/home/egmar/Documents/Projects/mult-game/build/bin/mult-game + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" diff --git a/Taskfile.yml b/Taskfile.yml index 112fded..71513ef 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -11,4 +11,8 @@ tasks: - ./bump-to.sh {{ .CLI_ARGS }} - git add . - git commit --amend --no-edit - - git tag v{{ .CLI_ARGS }} \ No newline at end of file + - git tag v{{ .CLI_ARGS }} + build:front: + cmds: + - npm ci && npm run build + dir: frontend/ \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index 7a5bc11..598dc56 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "frontend", "private": true, - "version": "2.0.2", + "version": "2.1.0", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/pages/Game.vue b/frontend/src/pages/Game.vue index 132a7a7..1b85e1a 100644 --- a/frontend/src/pages/Game.vue +++ b/frontend/src/pages/Game.vue @@ -11,9 +11,5 @@ const router = useRouter(); \ No newline at end of file diff --git a/frontend/src/stores/game.ts b/frontend/src/stores/game.ts index d319e25..01bbdab 100644 --- a/frontend/src/stores/game.ts +++ b/frontend/src/stores/game.ts @@ -31,6 +31,12 @@ export const useGameStore = defineStore('game', () => { game.prompt = game.x + " + " + game.y; game.result = game.x + game.y; break; + case GameMode.Min: + game.x = generateRandom(5, 15); + game.x = generateRandom(game.y, 20); + game.prompt = game.x + " - " + game.y; + game.result = game.x - game.y; + break; case GameMode.Mult: default: game.prompt = game.x + " X " + game.y; diff --git a/main.go b/main.go index e00c6a3..d6ac20c 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,7 @@ const ( ) var ( - current = semver.MustParse("2.0.2") + current = semver.MustParse("2.1.0") ) type Binder struct { diff --git a/wails.json b/wails.json index 9700988..1e89477 100644 --- a/wails.json +++ b/wails.json @@ -13,7 +13,7 @@ "info": { "companyName": "mJehanno", "productName": "mult-game", - "productVersion": "2.0.2", + "productVersion": "2.1.0", "copyright": "Copyright @mJehanno", "comments": "Built using Wails (https://wails.io)" },