mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
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 -->
This commit is contained in:
35
.github/workflows/main.yml
vendored
35
.github/workflows/main.yml
vendored
@@ -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
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"api":"3.10.0","web":"3.10.0"}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user