Add auto-release to Gitea on tag push
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,11 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
|
env:
|
||||||
|
PLUGIN_NAME: InstaDrums
|
||||||
|
GITEA_URL: https://1git.eu
|
||||||
|
GITEA_REPO: hariel/InstaDrums
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -21,7 +26,7 @@ jobs:
|
|||||||
apt-get install -y build-essential cmake git pkg-config \
|
apt-get install -y build-essential cmake git pkg-config \
|
||||||
libasound2-dev libfreetype6-dev libx11-dev libxrandr-dev \
|
libasound2-dev libfreetype6-dev libx11-dev libxrandr-dev \
|
||||||
libxcursor-dev libxinerama-dev libwebkit2gtk-4.1-dev \
|
libxcursor-dev libxinerama-dev libwebkit2gtk-4.1-dev \
|
||||||
libcurl4-openssl-dev zip
|
libcurl4-openssl-dev zip curl
|
||||||
|
|
||||||
- name: Clone JUCE
|
- name: Clone JUCE
|
||||||
run: git clone --depth 1 https://github.com/juce-framework/JUCE.git ../JUCE
|
run: git clone --depth 1 https://github.com/juce-framework/JUCE.git ../JUCE
|
||||||
@@ -32,11 +37,30 @@ jobs:
|
|||||||
- name: Build Release
|
- name: Build Release
|
||||||
run: cmake --build build --config Release --parallel $(nproc)
|
run: cmake --build build --config Release --parallel $(nproc)
|
||||||
|
|
||||||
- name: Package VST3
|
- name: Package
|
||||||
run: cd build/InstaDrums_artefacts/Release && zip -r ${GITHUB_WORKSPACE}/InstaDrums-VST3-Linux-x64.zip VST3/InstaDrums.vst3
|
run: |
|
||||||
|
cd build/${PLUGIN_NAME}_artefacts/Release
|
||||||
|
zip -r ${GITHUB_WORKSPACE}/${PLUGIN_NAME}-VST3-Linux-x64.zip VST3/${PLUGIN_NAME}.vst3
|
||||||
|
cd ${GITHUB_WORKSPACE}
|
||||||
|
zip -j ${PLUGIN_NAME}-Standalone-Linux-x64.zip build/${PLUGIN_NAME}_artefacts/Release/Standalone/${PLUGIN_NAME}
|
||||||
|
|
||||||
- name: Package Standalone
|
- name: Upload to Gitea Release
|
||||||
run: zip -j InstaDrums-Standalone-Linux-x64.zip build/InstaDrums_artefacts/Release/Standalone/InstaDrums
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_REF#refs/tags/}
|
||||||
|
# Create release
|
||||||
|
RELEASE_ID=$(curl -s -X POST "${GITEA_URL}/api/v1/repos/${GITEA_REPO}/releases" \
|
||||||
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${TAG}\", \"body\": \"${PLUGIN_NAME} ${TAG}\"}" \
|
||||||
|
| python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))")
|
||||||
|
# Upload assets
|
||||||
|
for f in ${PLUGIN_NAME}-*-Linux-*.zip; do
|
||||||
|
curl -s -X POST "${GITEA_URL}/api/v1/repos/${GITEA_REPO}/releases/${RELEASE_ID}/assets?name=$(basename $f)" \
|
||||||
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary "@$f"
|
||||||
|
done
|
||||||
|
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
@@ -52,8 +76,34 @@ jobs:
|
|||||||
- name: Build Release
|
- name: Build Release
|
||||||
run: cmake --build build --config Release
|
run: cmake --build build --config Release
|
||||||
|
|
||||||
- name: Package VST3
|
- name: Package
|
||||||
run: cd build/InstaDrums_artefacts/Release && zip -r ${GITHUB_WORKSPACE}/InstaDrums-VST3-macOS.zip VST3/InstaDrums.vst3
|
run: |
|
||||||
|
cd build/${PLUGIN_NAME}_artefacts/Release
|
||||||
|
zip -r ${GITHUB_WORKSPACE}/${PLUGIN_NAME}-VST3-macOS.zip VST3/${PLUGIN_NAME}.vst3
|
||||||
|
zip -r ${GITHUB_WORKSPACE}/${PLUGIN_NAME}-AU-macOS.zip AU/${PLUGIN_NAME}.component
|
||||||
|
cd ${GITHUB_WORKSPACE}
|
||||||
|
zip -r ${PLUGIN_NAME}-Standalone-macOS.zip build/${PLUGIN_NAME}_artefacts/Release/Standalone/${PLUGIN_NAME}.app
|
||||||
|
|
||||||
- name: Package AU
|
- name: Upload to Gitea Release
|
||||||
run: cd build/InstaDrums_artefacts/Release && zip -r ${GITHUB_WORKSPACE}/InstaDrums-AU-macOS.zip AU/InstaDrums.component
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_REF#refs/tags/}
|
||||||
|
# Get release ID (created by linux job)
|
||||||
|
RELEASE_ID=$(curl -s "${GITEA_URL}/api/v1/repos/${GITEA_REPO}/releases/tags/${TAG}" \
|
||||||
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
| python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))")
|
||||||
|
# If release doesn't exist yet, create it
|
||||||
|
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "None" ]; then
|
||||||
|
RELEASE_ID=$(curl -s -X POST "${GITEA_URL}/api/v1/repos/${GITEA_REPO}/releases" \
|
||||||
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${TAG}\", \"body\": \"${PLUGIN_NAME} ${TAG}\"}" \
|
||||||
|
| python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))")
|
||||||
|
fi
|
||||||
|
# Upload assets
|
||||||
|
for f in ${PLUGIN_NAME}-*-macOS*.zip; do
|
||||||
|
curl -s -X POST "${GITEA_URL}/api/v1/repos/${GITEA_REPO}/releases/${RELEASE_ID}/assets?name=$(basename $f)" \
|
||||||
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary "@$f"
|
||||||
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user