mirror of
https://git.unlock-music.dev/um/cli.git
synced 2025-05-23 16:47:40 +08:00
Compare commits
6 Commits
791f9c0621
...
369112af01
Author | SHA1 | Date | |
---|---|---|---|
|
369112af01 | ||
|
111952199f | ||
|
a217170077 | ||
|
1a943309fa | ||
|
c0649d1246 | ||
|
3344db1645 |
@ -1,5 +1,6 @@
|
||||
name: Build
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- "**/*.go"
|
||||
@ -25,13 +26,8 @@ jobs:
|
||||
- darwin
|
||||
GOARCH:
|
||||
- "amd64"
|
||||
- "386"
|
||||
- "arm64"
|
||||
|
||||
exclude:
|
||||
- GOOS: darwin
|
||||
GOARCH: "386"
|
||||
|
||||
include:
|
||||
- GOOS: windows
|
||||
BIN_SUFFIX: ".exe"
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -7,3 +7,6 @@
|
||||
/um-*.tar.gz
|
||||
/um-*.zip
|
||||
/.vscode
|
||||
|
||||
/prepare
|
||||
/dist
|
||||
|
14
README.md
14
README.md
@ -2,9 +2,9 @@
|
||||
|
||||
Original: Web Edition https://git.unlock-music.dev/um/web
|
||||
|
||||
- [](https://ci.unlock-music.dev/um/cli)
|
||||
- [](https://git.unlock-music.dev/um/cli/actions?workflow=build.yml)
|
||||
- [Release Download](https://git.unlock-music.dev/um/cli/releases/latest)
|
||||
- [Latest Build](https://git.unlock-music.dev/um/-/packages/generic/cli-build/)
|
||||
- [Latest Build](https://git.unlock-music.dev/um/cli/actions)
|
||||
|
||||
> **WARNING**
|
||||
> 在本站 fork 不会起到备份的作用,只会浪费服务器储存空间。如无必要请勿 fork 该仓库。
|
||||
@ -36,13 +36,3 @@ It will produce `um` or `um.exe` (Windows).
|
||||
- Drag the encrypted file to `um.exe` (Tested on Windows)
|
||||
- Run: `./um [-o <output dir>] [-i] <input dir/file>`
|
||||
- Use `./um -h` to show help menu
|
||||
|
||||
## Update CI pipeline
|
||||
|
||||
1. Install [Drone CI binary](https://docs.drone.io/cli/install/)
|
||||
2. Edit `.drone.jsonnet`
|
||||
3. Update drone CI pipeline:
|
||||
|
||||
```sh
|
||||
drone jsonnet --format --stream
|
||||
```
|
||||
|
@ -3,32 +3,40 @@
|
||||
|
||||
APP_VERSION="${1:-$(git describe --tags --always)}"
|
||||
|
||||
for exe in prepare/*/um-*.exe; do
|
||||
name="$(basename "$exe" .exe)-$APP_VERSION"
|
||||
new_exe="$(dirname "$exe")/um.exe"
|
||||
mv "$exe" "$new_exe"
|
||||
pack() {
|
||||
local is_windows=0
|
||||
local suffix=""
|
||||
if [[ "$1" == *.exe ]]; then
|
||||
suffix=".exe"
|
||||
is_windows=1
|
||||
fi
|
||||
|
||||
echo "archiving ${new_exe}..."
|
||||
zip -Xqj9 "dist/${name}.zip" "$new_exe"
|
||||
rm -f "$new_exe"
|
||||
done
|
||||
local exe_dir="$(dirname "$1")"
|
||||
local archive_name="$(basename "$1" ".exe")-${APP_VERSION}"
|
||||
local exe_name="um${suffix}"
|
||||
|
||||
for exe in prepare/*/um-*; do
|
||||
name="$(basename "$exe")-$APP_VERSION"
|
||||
new_exe="$(dirname "$exe")/um"
|
||||
mv "$exe" "$new_exe"
|
||||
echo "archiving ${exe_name}..."
|
||||
|
||||
echo "archiving ${new_exe}..."
|
||||
tar \
|
||||
--sort=name --format=posix \
|
||||
--pax-option=exthdr.name=%d/PaxHeaders/%f \
|
||||
--pax-option=delete=atime,delete=ctime \
|
||||
--clamp-mtime --mtime='1970-01-01T00:00:00Z' \
|
||||
--numeric-owner --owner=0 --group=0 \
|
||||
--mode=0755 \
|
||||
-c -C "$(dirname "$exe")" um |
|
||||
gzip -9 >"dist/${name}.tar.gz"
|
||||
rm -f "$exe"
|
||||
mv "$1" "${exe_name}"
|
||||
if [[ "$is_windows" == 1 ]]; then
|
||||
echo zip -Xqj9 "dist/${archive_name}.zip" "${exe_name}" README.md LICENSE
|
||||
exit 1
|
||||
else
|
||||
tar \
|
||||
--sort=name --format=posix \
|
||||
--pax-option=exthdr.name=%d/PaxHeaders/%f \
|
||||
--pax-option=delete=atime,delete=ctime \
|
||||
--clamp-mtime --mtime='1970-01-01T00:00:00Z' \
|
||||
--numeric-owner --owner=0 --group=0 \
|
||||
--mode=0755 -c \
|
||||
"${exe_name}" README.md LICENSE |
|
||||
gzip -9 >"dist/${archive_name}.tar.gz"
|
||||
fi
|
||||
rm -rf "$exe_dir" "${exe_name}"
|
||||
}
|
||||
|
||||
for exe in prepare/*/um*; do
|
||||
pack "$exe"
|
||||
done
|
||||
|
||||
pushd dist
|
||||
|
Loading…
x
Reference in New Issue
Block a user