diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f71ed04cd..fa047bee1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,8 +5,6 @@ on: push: branches: - main - tags: - - "v*" concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -14,7 +12,8 @@ concurrency: jobs: release-please: - if: startsWith(github.ref, 'refs/tags/') + # Only run release-please on pushes to main + if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest permissions: contents: write @@ -25,15 +24,6 @@ jobs: outputs: releases_created: ${{ steps.release.outputs.releases_created }} tag_name: ${{ steps.release.outputs.tag_name }} - start: - # This prevents a tag running twice as it'll have a "tag" and a "commit" event - # We only want the tag to run the action as it'll be able to create the release notes - if: (startsWith(github.event.ref, 'refs/heads/') && !startsWith(github.event.head_commit.message, 'chore(release)')) || (startsWith(github.event.ref, 'refs/tags/') && startsWith(github.event.head_commit.message, 'chore(release)')) - runs-on: ubuntu-latest - steps: - - name: Validate branch and tag - run: exit 0 - test-api: defaults: run: @@ -448,11 +438,10 @@ jobs: DEST_DIR: unraid-api create-draft-release: - # Only create new draft if this is a version tag - if: | - startsWith(github.ref, 'refs/tags/v') + # Only run if release-please created a release + if: needs.release-please.outputs.releases_created runs-on: ubuntu-latest - needs: [test-api, build-plugin] + needs: [release-please, test-api, build-plugin] steps: - name: Checkout repo uses: actions/checkout@v4 @@ -468,12 +457,12 @@ jobs: mv plugins/production/dynamix.unraid.net.plg release/ mv archive/*.txz release/ - - name: Create Github release - uses: softprops/action-gh-release@v1 - with: - draft: true - prerelease: false - files: | - release/* + - name: Upload Release Assets env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # For each file in release directory + for file in release/*; do + echo "Uploading $file to release..." + gh release upload ${{ needs.release-please.outputs.tag_name }} "$file" --clobber + done diff --git a/.release-please-manifest.json b/.release-please-manifest.json deleted file mode 100644 index 6932fd882..000000000 --- a/.release-please-manifest.json +++ /dev/null @@ -1 +0,0 @@ -{"api":"3.10.0","web":"3.10.0"} \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json index b5972a0bf..502759d08 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,9 +1,24 @@ { + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", "packages": { - "api": {}, - "web": {} + "api": { + "package-name": "@unraid/api", + "release-type": "node" + }, + "web": { + "package-name": "@unraid/web", + "release-type": "node" + }, + "unraid-ui": { + "package-name": "@unraid/ui", + "release-type": "node" + }, + "plugin": { + "package-name": "@unraid/connect-plugin", + "release-type": "node" + } }, "separate-pull-requests": false, "include-component-in-tag": false, - "skip-github-release": true + "draft": true } \ No newline at end of file