Skip to content

Commit 0dfd8f6

Browse files
committed
fix: small issues with main.yml and build-plugin.yml
1 parent 692092c commit 0dfd8f6

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.github/workflows/build-plugin.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
type: boolean
88
required: true
99
description: "Whether a release was created"
10+
RELEASE_TAG:
11+
type: string
12+
required: false
13+
description: "Name of the tag when a release is created"
1014
TAG:
1115
type: string
1216
required: false
@@ -139,13 +143,20 @@ jobs:
139143
env:
140144
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141145
run: |
142-
release_name=$(gh release list --repo ${{ github.repository }} --json name,isDraft --jq '.[] | select(.isDraft == true) | .name' | head -n 1)
143146
# For each file in release directory
144-
for file in deploy-prod/*; do
147+
for file in deploy/*; do
145148
echo "Uploading $file to release..."
146-
gh release upload "${release_name}" "$file" --clobber
149+
gh release upload "${inputs.RELEASE_TAG}" "$file" --clobber
147150
done
148151
152+
- name: Workflow Dispatch and wait
153+
if: inputs.RELEASE_CREATED == 'true'
154+
uses: the-actions-org/workflow-dispatch@v4.0.0
155+
with:
156+
workflow: release-production.yml
157+
inputs: '{ "version": "${{ steps.vars.outputs.API_VERSION }}" }'
158+
token: ${{ secrets.WORKFLOW_TRIGGER_PAT }}
159+
149160
- name: Upload to Cloudflare
150161
if: inputs.RELEASE_CREATED == 'false'
151162
env:

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ concurrency:
1313
jobs:
1414
release-please:
1515
name: Release Please
16-
# Only run release-please on pushes to main
1716
runs-on: ubuntu-latest
1817
permissions:
1918
contents: write
2019
pull-requests: write
2120
steps:
2221
- name: Checkout
2322
uses: actions/checkout@v4
23+
# Only run release-please on pushes to main
2424
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
2525

2626
- id: release
@@ -317,6 +317,7 @@ jobs:
317317
uses: ./.github/workflows/build-plugin.yml
318318
with:
319319
RELEASE_CREATED: ${{ needs.release-please.outputs.releases_created }}
320+
RELEASE_TAG: ${{ needs.release-please.outputs.tag_name }}
320321
TAG:
321322
BUCKET_PATH: unraid-api
322323
BASE_URL: "https://stable.dl.unraid.net/unraid-api"

0 commit comments

Comments
 (0)