Compare commits

...

6 Commits

Author SHA1 Message Date
鲁树人
369112af01 ci: fix repack script
Some checks failed
Build / build (.exe, amd64, windows) (push) Successful in 13m9s
Build / build (.exe, arm64, windows) (push) Successful in 13m7s
Build / build (amd64, darwin) (push) Successful in 13m13s
Build / build (amd64, linux) (push) Successful in 13m7s
Build / build (arm64, darwin) (push) Successful in 13m4s
Build / build (arm64, linux) (push) Successful in 13m12s
Build / archive (push) Failing after 26s
2025-05-09 05:06:40 +09:00
鲁树人
111952199f ci: allow manual trigger of build job 2025-05-09 05:03:00 +09:00
鲁树人
a217170077 ci: fix archive name and zip package 2025-05-09 05:00:21 +09:00
鲁树人
1a943309fa ci: simplify packing script logic 2025-05-09 04:47:18 +09:00
鲁树人
c0649d1246 ci: remove i386 target 2025-05-09 04:47:06 +09:00
鲁树人
3344db1645 docs: update reference to gitea actions 2025-05-08 07:11:55 +09:00
4 changed files with 37 additions and 40 deletions

View File

@ -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
View File

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

View File

@ -2,9 +2,9 @@
Original: Web Edition https://git.unlock-music.dev/um/web
- [![Build Status](https://ci.unlock-music.dev/api/badges/um/cli/status.svg)](https://ci.unlock-music.dev/um/cli)
- [![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)
- [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
```

View File

@ -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}..."
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 -C "$(dirname "$exe")" um |
gzip -9 >"dist/${name}.tar.gz"
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
pushd dist