Compare commits
No commits in common. "ce9379d1660dadf648b1e7751934d60f44bedd82" and "f819726f3ec21865198143b832df1cc0d289b567" have entirely different histories.
ce9379d166
...
f819726f3e
@ -17,28 +17,21 @@ local CreateRelease() = {
|
|||||||
|
|
||||||
|
|
||||||
local StepGoBuild(GOOS, GOARCH) = {
|
local StepGoBuild(GOOS, GOARCH) = {
|
||||||
local archiveExt = if GOOS == 'windows' then 'zip' else 'tar.gz',
|
local filepath = 'dist/um-%s-%s.tar.gz' % [GOOS, GOARCH],
|
||||||
local filepath = 'dist/um-%s-%s.%s' % [GOOS, GOARCH, archiveExt],
|
|
||||||
|
|
||||||
// run zip or tar command depending on GOOS been windows or other
|
|
||||||
local archive = if GOOS == 'windows' then [
|
|
||||||
'zip -9 -j -r "%s" $DIST_DIR' % filepath,
|
|
||||||
] else [
|
|
||||||
'tar -zc -C $DIST_DIR um | gzip -9 > "%s"' % filepath,
|
|
||||||
],
|
|
||||||
|
|
||||||
name: 'go build %s/%s' % [GOOS, GOARCH],
|
name: 'go build %s/%s' % [GOOS, GOARCH],
|
||||||
image: 'golang:1.22',
|
image: 'golang:1.22',
|
||||||
environment: {
|
environment: {
|
||||||
GOOS: GOOS,
|
GOOS: GOOS,
|
||||||
GOARCH: GOARCH,
|
GOARCH: GOARCH,
|
||||||
GOPROXY: 'https://goproxy.io,direct',
|
GOPROXY: "https://goproxy.io,direct",
|
||||||
},
|
},
|
||||||
commands: [
|
commands: [
|
||||||
'DIST_DIR=$(mktemp -d)',
|
'DIST_DIR=$(mktemp -d)',
|
||||||
'go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags --always)" -o $DIST_DIR ./cmd/um',
|
'go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags --always)" -o $DIST_DIR ./cmd/um',
|
||||||
'mkdir -p dist',
|
'mkdir -p dist',
|
||||||
] + archive,
|
'tar cz -f %s -C $DIST_DIR .' % filepath,
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
local StepUploadArtifact(GOOS, GOARCH) = {
|
local StepUploadArtifact(GOOS, GOARCH) = {
|
||||||
@ -78,7 +71,7 @@ local PipelineBuild(GOOS, GOARCH, RUN_TEST) = {
|
|||||||
name: 'go test',
|
name: 'go test',
|
||||||
image: 'golang:1.22',
|
image: 'golang:1.22',
|
||||||
environment: {
|
environment: {
|
||||||
GOPROXY: 'https://goproxy.io,direct',
|
GOPROXY: "https://goproxy.io,direct",
|
||||||
},
|
},
|
||||||
commands: ['go test -v ./...'],
|
commands: ['go test -v ./...'],
|
||||||
}] else []
|
}] else []
|
||||||
@ -107,7 +100,7 @@ local PipelineRelease() = {
|
|||||||
name: 'go test',
|
name: 'go test',
|
||||||
image: 'golang:1.22',
|
image: 'golang:1.22',
|
||||||
environment: {
|
environment: {
|
||||||
GOPROXY: 'https://goproxy.io,direct',
|
GOPROXY: "https://goproxy.io,direct",
|
||||||
},
|
},
|
||||||
commands: ['go test -v ./...'],
|
commands: ['go test -v ./...'],
|
||||||
},
|
},
|
||||||
|
88
.drone.yml
88
.drone.yml
@ -1,4 +1,5 @@
|
|||||||
- kind: pipeline
|
---
|
||||||
|
kind: pipeline
|
||||||
name: build linux/amd64
|
name: build linux/amd64
|
||||||
steps:
|
steps:
|
||||||
- commands:
|
- commands:
|
||||||
@ -13,10 +14,10 @@
|
|||||||
name: go test
|
name: go test
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe
|
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
|
||||||
--tags --always)" -o $DIST_DIR ./cmd/um
|
--always)" -o $DIST_DIR ./cmd/um
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- tar -zc -C $DIST_DIR um | gzip -9 > "dist/um-linux-amd64.tar.gz"
|
- tar cz -f dist/um-linux-amd64.tar.gz -C $DIST_DIR .
|
||||||
environment:
|
environment:
|
||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
@ -24,8 +25,8 @@
|
|||||||
image: golang:1.22
|
image: golang:1.22
|
||||||
name: go build linux/amd64
|
name: go build linux/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file
|
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-linux-amd64.tar.gz"
|
||||||
"dist/um-linux-amd64.tar.gz" "$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}/um-linux-amd64.tar.gz"
|
"$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}/um-linux-amd64.tar.gz"
|
||||||
- sha256sum dist/um-linux-amd64.tar.gz
|
- sha256sum dist/um-linux-amd64.tar.gz
|
||||||
- echo $DRONE_GITEA_SERVER/${DRONE_REPO_NAMESPACE}/-/packages/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}
|
- echo $DRONE_GITEA_SERVER/${DRONE_REPO_NAMESPACE}/-/packages/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}
|
||||||
environment:
|
environment:
|
||||||
@ -39,7 +40,8 @@
|
|||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
type: docker
|
type: docker
|
||||||
- kind: pipeline
|
---
|
||||||
|
kind: pipeline
|
||||||
name: build windows/amd64
|
name: build windows/amd64
|
||||||
steps:
|
steps:
|
||||||
- commands:
|
- commands:
|
||||||
@ -48,10 +50,10 @@
|
|||||||
name: fetch tags
|
name: fetch tags
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe
|
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
|
||||||
--tags --always)" -o $DIST_DIR ./cmd/um
|
--always)" -o $DIST_DIR ./cmd/um
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- zip -9 -j -r "dist/um-windows-amd64.zip" $DIST_DIR
|
- tar cz -f dist/um-windows-amd64.tar.gz -C $DIST_DIR .
|
||||||
environment:
|
environment:
|
||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: windows
|
GOOS: windows
|
||||||
@ -59,8 +61,8 @@
|
|||||||
image: golang:1.22
|
image: golang:1.22
|
||||||
name: go build windows/amd64
|
name: go build windows/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file
|
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-windows-amd64.tar.gz"
|
||||||
"dist/um-windows-amd64.tar.gz" "$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}/um-windows-amd64.tar.gz"
|
"$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}/um-windows-amd64.tar.gz"
|
||||||
- sha256sum dist/um-windows-amd64.tar.gz
|
- sha256sum dist/um-windows-amd64.tar.gz
|
||||||
- echo $DRONE_GITEA_SERVER/${DRONE_REPO_NAMESPACE}/-/packages/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}
|
- echo $DRONE_GITEA_SERVER/${DRONE_REPO_NAMESPACE}/-/packages/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}
|
||||||
environment:
|
environment:
|
||||||
@ -74,7 +76,8 @@
|
|||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
type: docker
|
type: docker
|
||||||
- kind: pipeline
|
---
|
||||||
|
kind: pipeline
|
||||||
name: build darwin/amd64
|
name: build darwin/amd64
|
||||||
steps:
|
steps:
|
||||||
- commands:
|
- commands:
|
||||||
@ -83,10 +86,10 @@
|
|||||||
name: fetch tags
|
name: fetch tags
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe
|
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
|
||||||
--tags --always)" -o $DIST_DIR ./cmd/um
|
--always)" -o $DIST_DIR ./cmd/um
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- tar -zc -C $DIST_DIR um | gzip -9 > "dist/um-darwin-amd64.tar.gz"
|
- tar cz -f dist/um-darwin-amd64.tar.gz -C $DIST_DIR .
|
||||||
environment:
|
environment:
|
||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: darwin
|
GOOS: darwin
|
||||||
@ -94,8 +97,8 @@
|
|||||||
image: golang:1.22
|
image: golang:1.22
|
||||||
name: go build darwin/amd64
|
name: go build darwin/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file
|
- curl --fail --include --user "um-release-bot:$GITEA_API_KEY" --upload-file "dist/um-darwin-amd64.tar.gz"
|
||||||
"dist/um-darwin-amd64.tar.gz" "$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}/um-darwin-amd64.tar.gz"
|
"$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}/um-darwin-amd64.tar.gz"
|
||||||
- sha256sum dist/um-darwin-amd64.tar.gz
|
- sha256sum dist/um-darwin-amd64.tar.gz
|
||||||
- echo $DRONE_GITEA_SERVER/${DRONE_REPO_NAMESPACE}/-/packages/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}
|
- echo $DRONE_GITEA_SERVER/${DRONE_REPO_NAMESPACE}/-/packages/generic/${DRONE_REPO_NAME}-build/${DRONE_BUILD_NUMBER}
|
||||||
environment:
|
environment:
|
||||||
@ -109,7 +112,8 @@
|
|||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
type: docker
|
type: docker
|
||||||
- kind: pipeline
|
---
|
||||||
|
kind: pipeline
|
||||||
name: release
|
name: release
|
||||||
steps:
|
steps:
|
||||||
- commands:
|
- commands:
|
||||||
@ -124,10 +128,10 @@
|
|||||||
name: go test
|
name: go test
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe
|
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
|
||||||
--tags --always)" -o $DIST_DIR ./cmd/um
|
--always)" -o $DIST_DIR ./cmd/um
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- tar -zc -C $DIST_DIR um | gzip -9 > "dist/um-linux-amd64.tar.gz"
|
- tar cz -f dist/um-linux-amd64.tar.gz -C $DIST_DIR .
|
||||||
environment:
|
environment:
|
||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
@ -136,10 +140,10 @@
|
|||||||
name: go build linux/amd64
|
name: go build linux/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe
|
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
|
||||||
--tags --always)" -o $DIST_DIR ./cmd/um
|
--always)" -o $DIST_DIR ./cmd/um
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- tar -zc -C $DIST_DIR um | gzip -9 > "dist/um-linux-arm64.tar.gz"
|
- tar cz -f dist/um-linux-arm64.tar.gz -C $DIST_DIR .
|
||||||
environment:
|
environment:
|
||||||
GOARCH: arm64
|
GOARCH: arm64
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
@ -148,22 +152,22 @@
|
|||||||
name: go build linux/arm64
|
name: go build linux/arm64
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe
|
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
|
||||||
--tags --always)" -o $DIST_DIR ./cmd/um
|
--always)" -o $DIST_DIR ./cmd/um
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- tar -zc -C $DIST_DIR um | gzip -9 > "dist/um-linux-386.tar.gz"
|
- tar cz -f dist/um-linux-386.tar.gz -C $DIST_DIR .
|
||||||
environment:
|
environment:
|
||||||
GOARCH: '386'
|
GOARCH: "386"
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.22
|
||||||
name: go build linux/386
|
name: go build linux/386
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe
|
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
|
||||||
--tags --always)" -o $DIST_DIR ./cmd/um
|
--always)" -o $DIST_DIR ./cmd/um
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- zip -9 -j -r "dist/um-windows-amd64.zip" $DIST_DIR
|
- tar cz -f dist/um-windows-amd64.tar.gz -C $DIST_DIR .
|
||||||
environment:
|
environment:
|
||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: windows
|
GOOS: windows
|
||||||
@ -172,22 +176,22 @@
|
|||||||
name: go build windows/amd64
|
name: go build windows/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe
|
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
|
||||||
--tags --always)" -o $DIST_DIR ./cmd/um
|
--always)" -o $DIST_DIR ./cmd/um
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- zip -9 -j -r "dist/um-windows-386.zip" $DIST_DIR
|
- tar cz -f dist/um-windows-386.tar.gz -C $DIST_DIR .
|
||||||
environment:
|
environment:
|
||||||
GOARCH: '386'
|
GOARCH: "386"
|
||||||
GOOS: windows
|
GOOS: windows
|
||||||
GOPROXY: https://goproxy.io,direct
|
GOPROXY: https://goproxy.io,direct
|
||||||
image: golang:1.22
|
image: golang:1.22
|
||||||
name: go build windows/386
|
name: go build windows/386
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe
|
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
|
||||||
--tags --always)" -o $DIST_DIR ./cmd/um
|
--always)" -o $DIST_DIR ./cmd/um
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- tar -zc -C $DIST_DIR um | gzip -9 > "dist/um-darwin-amd64.tar.gz"
|
- tar cz -f dist/um-darwin-amd64.tar.gz -C $DIST_DIR .
|
||||||
environment:
|
environment:
|
||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOS: darwin
|
GOOS: darwin
|
||||||
@ -196,10 +200,10 @@
|
|||||||
name: go build darwin/amd64
|
name: go build darwin/amd64
|
||||||
- commands:
|
- commands:
|
||||||
- DIST_DIR=$(mktemp -d)
|
- DIST_DIR=$(mktemp -d)
|
||||||
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe
|
- go build -v -trimpath -ldflags="-w -s -X main.AppVersion=$(git describe --tags
|
||||||
--tags --always)" -o $DIST_DIR ./cmd/um
|
--always)" -o $DIST_DIR ./cmd/um
|
||||||
- mkdir -p dist
|
- mkdir -p dist
|
||||||
- tar -zc -C $DIST_DIR um | gzip -9 > "dist/um-darwin-arm64.tar.gz"
|
- tar cz -f dist/um-darwin-arm64.tar.gz -C $DIST_DIR .
|
||||||
environment:
|
environment:
|
||||||
GOARCH: arm64
|
GOARCH: arm64
|
||||||
GOOS: darwin
|
GOOS: darwin
|
||||||
|
16
README.md
16
README.md
@ -25,19 +25,3 @@ Original: Web Edition https://git.unlock-music.dev/um/web
|
|||||||
- Drag the encrypted file to `um.exe` (Tested on Windows)
|
- Drag the encrypted file to `um.exe` (Tested on Windows)
|
||||||
- Run: `./um [-o <output dir>] [-i] <input dir/file>`
|
- Run: `./um [-o <output dir>] [-i] <input dir/file>`
|
||||||
- Use `./um -h` to show help menu
|
- Use `./um -h` to show help menu
|
||||||
|
|
||||||
## Update CI pipeline
|
|
||||||
|
|
||||||
Ensure `jsonnet` and `yq` is installed.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Debian / Ubuntu etc:
|
|
||||||
sudo apt install jsonnet yq
|
|
||||||
```
|
|
||||||
|
|
||||||
1. Edit `.drone.jsonnet`
|
|
||||||
2. Update drone CI pipeline:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
jsonnet .drone.jsonnet | yq -y > .drone.yml
|
|
||||||
```
|
|
||||||
|
Loading…
Reference in New Issue
Block a user