Fix CI: drop linux-arm64, add actual release asset upload via API
Build AD Bulk Tool / Linux x64 (push) Failing after 3m1s
Build AD Bulk Tool / Windows x64 (push) Failing after 3m49s
Build AD Bulk Tool / macOS ARM64 (push) Failing after 3m3s
Build AD Bulk Tool / macOS x64 (push) Failing after 3m3s
Build AD Bulk Tool / release (push) Skipped
Build AD Bulk Tool / Linux x64 (push) Failing after 3m1s
Build AD Bulk Tool / Windows x64 (push) Failing after 3m49s
Build AD Bulk Tool / macOS ARM64 (push) Failing after 3m3s
Build AD Bulk Tool / macOS x64 (push) Failing after 3m3s
Build AD Bulk Tool / release (push) Skipped
This commit is contained in:
+35
-25
@@ -13,26 +13,18 @@ jobs:
|
||||
include:
|
||||
- rid: win-x64
|
||||
name: Windows x64
|
||||
os: ubuntu-latest
|
||||
suffix: .exe
|
||||
- rid: linux-x64
|
||||
name: Linux x64
|
||||
os: ubuntu-latest
|
||||
suffix: ''
|
||||
- rid: linux-arm64
|
||||
name: Linux ARM64
|
||||
os: ubuntu-latest
|
||||
suffix: ''
|
||||
- rid: osx-x64
|
||||
name: macOS x64
|
||||
os: ubuntu-latest
|
||||
suffix: ''
|
||||
- rid: osx-arm64
|
||||
name: macOS ARM64
|
||||
os: ubuntu-latest
|
||||
suffix: ''
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -52,13 +44,14 @@ jobs:
|
||||
chmod +x packaging/build-deb.sh
|
||||
packaging/build-deb.sh publish/linux-x64/ADBulkTool "${GITHUB_REF_NAME:-1.0.0}"
|
||||
|
||||
- name: Upload binary
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ADBulkTool-${{ matrix.rid }}
|
||||
path: publish/${{ matrix.rid }}/ADBulkTool${{ matrix.suffix }}
|
||||
if-no-files-found: error
|
||||
|
||||
packaging:
|
||||
release:
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
||||
@@ -67,23 +60,40 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download all binaries
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Create release
|
||||
- name: Upload release assets
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
set -x
|
||||
set -eux
|
||||
VERSION="${GITHUB_REF_NAME}"
|
||||
API="http://192.168.1.4:30008/api/v1/repos/mikisoq/ADBulk/releases"
|
||||
|
||||
# Get the release ID for this tag
|
||||
RELEASE_ID=$(curl -s -H "Authorization: token $GITEA_TOKEN" \
|
||||
"$API/tags/$VERSION" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||
|
||||
upload() {
|
||||
local file="$1"
|
||||
local name="$2"
|
||||
echo "Uploading $name..."
|
||||
curl -s -X POST -H "Authorization: token $GITEA_TOKEN" \
|
||||
-F "attachment=@$file" \
|
||||
"$API/$RELEASE_ID/assets?name=$name"
|
||||
}
|
||||
|
||||
# Build .deb and upload everything
|
||||
mkdir -p deb_root/DEBIAN deb_root/usr/bin
|
||||
cp ADBulkTool-linux-x64/ADBulkTool deb_root/usr/bin/adbulktool
|
||||
chmod 755 deb_root/usr/bin/adbulktool
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
sed "s/Version: 1.0.0/Version: $VERSION/" packaging/debian/DEBIAN/control > deb_root/DEBIAN/control
|
||||
dpkg-deb --root-owner-group --build deb_root "ADBulkTool-linux-x64/adbulktool_${VERSION}_amd64.deb"
|
||||
cp packaging/arch/PKGBUILD packaging/arch/.INSTALL ADBulkTool-linux-x64/
|
||||
for dir in ADBulkTool-*/; do
|
||||
for file in "$dir"*; do
|
||||
if [ -f "$file" ]; then
|
||||
echo "Uploading: $file"
|
||||
fi
|
||||
done
|
||||
done
|
||||
VERS="${VERSION#v}"
|
||||
sed "s/Version: 1.0.0/Version: $VERS/" packaging/debian/DEBIAN/control > deb_root/DEBIAN/control
|
||||
dpkg-deb --root-owner-group --build deb_root "adbulktool_${VERS}_amd64.deb"
|
||||
|
||||
upload "ADBulkTool-linux-x64/ADBulkTool" "ADBulkTool-linux-x64"
|
||||
upload "ADBulkTool-win-x64/ADBulkTool.exe" "ADBulkTool-win-x64.exe"
|
||||
upload "ADBulkTool-osx-x64/ADBulkTool" "ADBulkTool-macos-x64"
|
||||
upload "ADBulkTool-osx-arm64/ADBulkTool" "ADBulkTool-macos-arm64"
|
||||
upload "adbulktool_${VERS}_amd64.deb" "adbulktool_${VERS}_amd64.deb"
|
||||
|
||||
Reference in New Issue
Block a user