Compare commits

..

No commits in common. "369112af01d882d2b90d5d32421d9d1ebab382ee" and "791f9c06210ea3c7eb95b616e7d2af3d1581c43b" have entirely different histories.

4 changed files with 40 additions and 37 deletions

View File

@ -1,6 +1,5 @@
name: Build name: Build
on: on:
workflow_dispatch:
push: push:
paths: paths:
- "**/*.go" - "**/*.go"
@ -26,8 +25,13 @@ jobs:
- darwin - darwin
GOARCH: GOARCH:
- "amd64" - "amd64"
- "386"
- "arm64" - "arm64"
exclude:
- GOOS: darwin
GOARCH: "386"
include: include:
- GOOS: windows - GOOS: windows
BIN_SUFFIX: ".exe" BIN_SUFFIX: ".exe"

3
.gitignore vendored
View File

@ -7,6 +7,3 @@
/um-*.tar.gz /um-*.tar.gz
/um-*.zip /um-*.zip
/.vscode /.vscode
/prepare
/dist

View File

@ -2,9 +2,9 @@
Original: Web Edition https://git.unlock-music.dev/um/web Original: Web Edition https://git.unlock-music.dev/um/web
- [![Build Status](https://git.unlock-music.dev/um/cli/actions/workflows/build.yml/badge.svg)](https://git.unlock-music.dev/um/cli/actions?workflow=build.yml) - [![Build Status](https://ci.unlock-music.dev/api/badges/um/cli/status.svg)](https://ci.unlock-music.dev/um/cli)
- [Release Download](https://git.unlock-music.dev/um/cli/releases/latest) - [Release Download](https://git.unlock-music.dev/um/cli/releases/latest)
- [Latest Build](https://git.unlock-music.dev/um/cli/actions) - [Latest Build](https://git.unlock-music.dev/um/-/packages/generic/cli-build/)
> **WARNING** > **WARNING**
> 在本站 fork 不会起到备份的作用,只会浪费服务器储存空间。如无必要请勿 fork 该仓库。 > 在本站 fork 不会起到备份的作用,只会浪费服务器储存空间。如无必要请勿 fork 该仓库。
@ -36,3 +36,13 @@ It will produce `um` or `um.exe` (Windows).
- 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
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
```

View File

@ -3,40 +3,32 @@
APP_VERSION="${1:-$(git describe --tags --always)}" APP_VERSION="${1:-$(git describe --tags --always)}"
pack() { for exe in prepare/*/um-*.exe; do
local is_windows=0 name="$(basename "$exe" .exe)-$APP_VERSION"
local suffix="" new_exe="$(dirname "$exe")/um.exe"
if [[ "$1" == *.exe ]]; then mv "$exe" "$new_exe"
suffix=".exe"
is_windows=1
fi
local exe_dir="$(dirname "$1")" echo "archiving ${new_exe}..."
local archive_name="$(basename "$1" ".exe")-${APP_VERSION}" zip -Xqj9 "dist/${name}.zip" "$new_exe"
local exe_name="um${suffix}" rm -f "$new_exe"
done
echo "archiving ${exe_name}..." for exe in prepare/*/um-*; do
name="$(basename "$exe")-$APP_VERSION"
new_exe="$(dirname "$exe")/um"
mv "$exe" "$new_exe"
mv "$1" "${exe_name}" echo "archiving ${new_exe}..."
if [[ "$is_windows" == 1 ]]; then tar \
echo zip -Xqj9 "dist/${archive_name}.zip" "${exe_name}" README.md LICENSE --sort=name --format=posix \
exit 1 --pax-option=exthdr.name=%d/PaxHeaders/%f \
else --pax-option=delete=atime,delete=ctime \
tar \ --clamp-mtime --mtime='1970-01-01T00:00:00Z' \
--sort=name --format=posix \ --numeric-owner --owner=0 --group=0 \
--pax-option=exthdr.name=%d/PaxHeaders/%f \ --mode=0755 \
--pax-option=delete=atime,delete=ctime \ -c -C "$(dirname "$exe")" um |
--clamp-mtime --mtime='1970-01-01T00:00:00Z' \ gzip -9 >"dist/${name}.tar.gz"
--numeric-owner --owner=0 --group=0 \ rm -f "$exe"
--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 done
pushd dist pushd dist