Skip to content
Closed
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
43 changes: 43 additions & 0 deletions .github/workflows/release-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release Windows Binary

on:
push:
branches:
- main

permissions:
contents: write

jobs:
build-windows:
name: Build and release miactl.exe
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
show-progress: false

- name: Setup Golang
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version-file: go.mod

- name: Build Windows binary
run: |
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build \
-trimpath \
-ldflags "-s -w" \
-o miactl.exe \
./cmd/miactl

- name: Publish latest-windows release
run: |
gh release delete latest-windows --yes 2>/dev/null || true
gh release create latest-windows \
--title "Latest Windows Build ($(git rev-parse --short HEAD))" \
--notes "Auto-built Windows amd64 binary from commit $(git rev-parse HEAD)." \
--prerelease \
miactl.exe
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions internal/authorization/browser_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright Mia srl
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package authorization

import "os/exec"

func openBrowser(url string) error {
cmd := exec.Command("rundll32", "url.dll,FileProtocolHandler", url)
return cmd.Run()
}
Loading