Skip to content

Commit 85aaab5

Browse files
authored
feat: major release-please workflow improvements (#1160)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Expanded release configuration now covers additional components for broader integration. - **Chores** - Streamlined automated release workflows for more efficient asset uploads. - Refined job triggers to focus release creation on updates to the main branch. - Removed outdated version tracking to simplify the release process. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 8d5db7a commit 85aaab5

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ on:
55
push:
66
branches:
77
- main
8-
tags:
9-
- "v*"
108

119
concurrency:
1210
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1311
cancel-in-progress: true
1412

1513
jobs:
1614
release-please:
17-
if: startsWith(github.ref, 'refs/tags/')
15+
# Only run release-please on pushes to main
16+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
1817
runs-on: ubuntu-latest
1918
permissions:
2019
contents: write
@@ -25,15 +24,6 @@ jobs:
2524
outputs:
2625
releases_created: ${{ steps.release.outputs.releases_created }}
2726
tag_name: ${{ steps.release.outputs.tag_name }}
28-
start:
29-
# This prevents a tag running twice as it'll have a "tag" and a "commit" event
30-
# We only want the tag to run the action as it'll be able to create the release notes
31-
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)'))
32-
runs-on: ubuntu-latest
33-
steps:
34-
- name: Validate branch and tag
35-
run: exit 0
36-
3727
test-api:
3828
defaults:
3929
run:
@@ -448,11 +438,10 @@ jobs:
448438
DEST_DIR: unraid-api
449439

450440
create-draft-release:
451-
# Only create new draft if this is a version tag
452-
if: |
453-
startsWith(github.ref, 'refs/tags/v')
441+
# Only run if release-please created a release
442+
if: needs.release-please.outputs.releases_created
454443
runs-on: ubuntu-latest
455-
needs: [test-api, build-plugin]
444+
needs: [release-please, test-api, build-plugin]
456445
steps:
457446
- name: Checkout repo
458447
uses: actions/checkout@v4
@@ -468,12 +457,12 @@ jobs:
468457
mv plugins/production/dynamix.unraid.net.plg release/
469458
mv archive/*.txz release/
470459
471-
- name: Create Github release
472-
uses: softprops/action-gh-release@v1
473-
with:
474-
draft: true
475-
prerelease: false
476-
files: |
477-
release/*
460+
- name: Upload Release Assets
478461
env:
479462
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
463+
run: |
464+
# For each file in release directory
465+
for file in release/*; do
466+
echo "Uploading $file to release..."
467+
gh release upload ${{ needs.release-please.outputs.tag_name }} "$file" --clobber
468+
done

.release-please-manifest.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

release-please-config.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
23
"packages": {
3-
"api": {},
4-
"web": {}
4+
"api": {
5+
"package-name": "@unraid/api",
6+
"release-type": "node"
7+
},
8+
"web": {
9+
"package-name": "@unraid/web",
10+
"release-type": "node"
11+
},
12+
"unraid-ui": {
13+
"package-name": "@unraid/ui",
14+
"release-type": "node"
15+
},
16+
"plugin": {
17+
"package-name": "@unraid/connect-plugin",
18+
"release-type": "node"
19+
}
520
},
621
"separate-pull-requests": false,
722
"include-component-in-tag": false,
8-
"skip-github-release": true
23+
"draft": true
924
}

0 commit comments

Comments
 (0)