From 7fac0e50bbff3a450bced7e90313bf2765652342 Mon Sep 17 00:00:00 2001 From: niklascfw Date: Fri, 13 Feb 2026 22:08:40 +0100 Subject: [PATCH] Updated CI --- .github/workflows/build.yml | 24 +++++++++++ .github/workflows/release.yml | 77 ----------------------------------- README.md | 6 +-- 3 files changed, 25 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b38b8b8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,24 @@ +name: Build + +on: + push: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build payload + run: | + docker run --rm -v "${{ github.workspace }}:/work" -w /work \ + -e DEVKITARM=/opt/devkitpro/devkitARM \ + devkitpro/devkitarm:20251231 make + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: OmniNX-Installer + path: output/OmniNX-Installer.bin diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 9cceb1a..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Build and Release - -on: - push: - tags: - - '*.*.*' - -jobs: - build-and-release: - runs-on: ubuntu-latest - container: - image: devkitpro/devkitarm:20251231 - - steps: - - name: Checkout - env: - GITHUB_REF: ${{ github.ref }} - TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPO: ${{ github.repository }} - SERVER_URL: ${{ github.server_url }} - run: | - TAG="${GITHUB_REF#refs/tags/}" - HOST="${SERVER_URL#https://}" - git clone --depth 1 --branch "$TAG" "https://x-access-token:${TOKEN}@${HOST}/${REPO}.git" . - - - name: Build payload - env: - DEVKITARM: /opt/devkitpro/devkitARM - run: make - - - name: Create release and upload asset - env: - SERVER_URL: ${{ github.server_url }} - API_URL: ${{ github.api_url }} - REPOSITORY: ${{ github.repository }} - GITHUB_REF: ${{ github.ref }} - TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - TAG="${GITHUB_REF#refs/tags/}" - BIN_PATH="output/OmniNX-Installer.bin" - - # API URL: GitHub uses api.github.com, Gitea uses server_url/api/v1 - if [[ "$API_URL" != "" ]]; then - API_BASE="$API_URL" - else - API_BASE="$SERVER_URL/api/v1" - fi - - # Create release - RELEASE_RESPONSE=$(curl -s -X POST \ - -H "Authorization: token $TOKEN" \ - -H "Content-Type: application/json" \ - -d "{\"tag_name\": \"$TAG\", \"name\": \"Release $TAG\", \"body\": \"OmniNX Installer Payload $TAG\"}" \ - "$API_BASE/repos/$REPOSITORY/releases") - - RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2) - UPLOAD_URL=$(echo "$RELEASE_RESPONSE" | grep -o '"upload_url":"[^"]*' | head -1 | cut -d'"' -f4) - - if [ -z "$RELEASE_ID" ]; then - echo "Failed to create release. Response: $RELEASE_RESPONSE" - exit 1 - fi - - # Upload asset (GitHub uses upload_url; Gitea uses assets endpoint) - if [[ -n "$UPLOAD_URL" ]]; then - UPLOAD_URL="${UPLOAD_URL%%\{*}" - curl -X POST \ - -H "Authorization: token $TOKEN" \ - -H "Content-Type: application/octet-stream" \ - --data-binary "@$BIN_PATH" \ - "${UPLOAD_URL}?name=OmniNX-Installer.bin" - else - curl -X POST \ - -H "Authorization: token $TOKEN" \ - -F "attachment=@$BIN_PATH" \ - "$API_BASE/repos/$REPOSITORY/releases/$RELEASE_ID/assets?name=OmniNX-Installer.bin" - fi diff --git a/README.md b/README.md index c38c75e..499c196 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,7 @@ The built payload will be output to `output/OmniNX-Installer.bin`. ### CI / GitHub Actions -Pushing a version tag (e.g. `v1.0.0`) triggers a build and creates a release with the `.bin` file attached. - -**GitHub:** Uses the built-in `GITHUB_TOKEN` automatically. - -**Gitea:** Add a `GITHUB_TOKEN` secret (Settings → Secrets and Variables → Actions) with a token that has permission to create releases. +Every push triggers a build. The `.bin` file is produced and attached as a workflow artifact (Actions tab → select run → Artifacts). ## Usage