-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* switch to new ansi package so I don't depend on frog and go-isatty * clean up magefile * add reinstall-mage bash script
- Loading branch information
1 parent
46aa0f2
commit e8713aa
Showing
13 changed files
with
189 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: build release zip | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
release: | ||
name: Release Go Binary | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: wangyoucao577/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: windows | ||
goarch: amd64 | ||
goversion: "go.mod" | ||
project_path: "./cmd/upmyip" | ||
ldflags: | ||
'-X "github.com/danbrakeley/upmyip/internal/buildvar.Version=${{ github.event.release.tag_name }}" | ||
-X "github.com/danbrakeley/upmyip/internal/buildvar.BuildTime=${{ github.event.release.created_at | ||
}}" -X "github.com/danbrakeley/upmyip/internal/buildvar.ReleaseURL=${{ | ||
github.event.release.html_url }}"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: validate commit | ||
on: [pull_request] | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- | ||
uses: actions/checkout@v4 | ||
- | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
- | ||
uses: magefile/mage-action@v3 | ||
with: | ||
version: latest | ||
args: ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Build & Debug", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "debug", | ||
"program": "cmd/upmyip", | ||
"output": "local", | ||
"cwd": "local", | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package buildvar | ||
|
||
// -ldflags '-X "github.com/danbrakeley/upmyip/internal/buildvar.Version=${{ github.event.release.tag_name }}"' | ||
var Version string | ||
|
||
// -ldflags '-X "github.com/danbrakeley/upmyip/internal/buildvar.BuildTime=${{ github.event.release.created_at }}"' | ||
var BuildTime string | ||
|
||
// -ldflags '-X "github.com/danbrakeley/upmyip/internal/buildvar.ReleaseURL=${{ github.event.release.html_url }}"' | ||
var ReleaseURL string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash -e | ||
cd $(dirname "$0") | ||
|
||
TMPFOLDER=$(mktemp -d) || exit 1 | ||
trap 'rm -rf "$TMPFOLDER"' EXIT | ||
|
||
if command -v mage &> /dev/null | ||
then | ||
echo "--- MAGE VERSION BEFORE" | ||
mage -version | ||
echo "---" | ||
fi | ||
|
||
cd $TMPFOLDER | ||
git clone https://github.com/magefile/mage | ||
cd mage | ||
go run bootstrap.go | ||
|
||
echo "--- MAGE VERSION" | ||
mage -version | ||
echo "---" |