chore(ci): test build workflow #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Upload Only | |
'on': | |
push: | |
branches: | |
- test | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
test-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download previous artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
run-id: 13145147522 | |
- name: Extract version from Windows binary | |
id: extract_version | |
run: | | |
# Find the Windows executable using known naming pattern | |
exe_path=$(find artifacts/windows-latest/nsis -name "MARCUSK Launcher_*_x64-setup.exe" | head -1) | |
# Extract version using pattern matching | |
filename=$(basename "$exe_path") | |
version=$(echo "$filename" | sed -E 's/MARCUSK Launcher_([0-9]+\.[0-9]+\.[0-9]+)_x64-setup.exe/\1/') | |
echo "version=$version" >> $GITHUB_OUTPUT | |
- name: Upload to Cloudflare R2 (Test) | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }} | |
S3_ENDPOINT: ${{ secrets.CLOUDFLARE_R2_CDN_ENDPOINT }} | |
DOWNLOAD_URL_BASE: 'https://cdn.marcuskstudio.live' | |
VERSION: ${{ steps.extract_version.outputs.version }} | |
run: | | |
echo "=== TEST RUN - Would upload version ${VERSION} ===" | |
aws s3 cp artifacts s3://launcherbinaries/releases/latest/ \ | |
--recursive \ | |
--endpoint-url=${S3_ENDPOINT} \ | |
cat > update-manifest.json << EOF | |
{ | |
"version": "${VERSION}", | |
"notes": "[TEST] See the assets to download this version and install.", | |
"pub_date": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")", | |
"platforms": { | |
"darwin-x86_64": { | |
"signature": "$(cat artifacts/macos-latest/*/*.app.tar.gz.sig)", | |
"url": "${DOWNLOAD_URL_BASE}/releases/latest/$(basename artifacts/macos-latest/*/*.app.tar.gz)" | |
}, | |
"windows-x86_64": { | |
"signature": "$(cat artifacts/windows-latest/msi/*.msi.zip.sig)", | |
"url": "${DOWNLOAD_URL_BASE}/releases/latest/$(basename artifacts/windows-latest/msi/*.msi.zip)" | |
} | |
} | |
} | |
EOF | |
echo "=== Generated update-manifest.json ===" | |
cat update-manifest.json | |
aws s3 cp update-manifest.json s3://launcherbinaries/update-manifest.json \ | |
--endpoint-url=${S3_ENDPOINT} |