From f38bf674e060c3abbf8eb5519667a2f72875fdcd Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Sun, 18 May 2025 22:15:44 +1000 Subject: [PATCH 1/2] add publish to Chocolatey dispatch event --- .github/workflows/release_deploy.yml | 34 ++++++++++++++++++++++++++++ .github/workflows/website_deploy.yml | 21 ----------------- 2 files changed, 34 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/release_deploy.yml delete mode 100644 .github/workflows/website_deploy.yml diff --git a/.github/workflows/release_deploy.yml b/.github/workflows/release_deploy.yml new file mode 100644 index 00000000000..028f0045af0 --- /dev/null +++ b/.github/workflows/release_deploy.yml @@ -0,0 +1,34 @@ +--- + +name: New Release Deployments +on: + release: + types: [published] + workflow_dispatch: + +jobs: + deploy-website: + runs-on: ubuntu-latest + steps: + - name: Trigger dispatch event for deploying website + run: | + http_status=$(curl -L -f -s -o /dev/null -w "%{http_code}" \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.DEPLOY_FLOW_WEBSITE }}" \ + https://api.github.com/repos/Flow-Launcher/flow-launcher.github.io/dispatches \ + -d '{"event_type":"deploy"}') + if [ "$http_status" -ne 204 ]; then echo "Error: Deploy website failed, HTTP status code is $http_status"; exit 1; fi + + publish-chocolatey: + runs-on: ubuntu-latest + steps: + - name: Trigger dispatch event for publishing to Chocolatey + run: | + http_status=$(curl -L -f -s -o /dev/null -w "%{http_code}" \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.Publish_Chocolatey }}" \ + https://api.github.com/repos/Flow-Launcher/chocolatey-package/dispatches \ + -d '{"event_type":"publish"}') + if [ "$http_status" -ne 204 ]; then echo "Error: Publish Chocolatey Packaged failed, HTTP status code is $http_status"; exit 1; fi diff --git a/.github/workflows/website_deploy.yml b/.github/workflows/website_deploy.yml deleted file mode 100644 index 2d44e4a2c78..00000000000 --- a/.github/workflows/website_deploy.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- - -name: Deploy Website On Release -on: - release: - types: [published] - workflow_dispatch: - -jobs: - dispatch: - runs-on: ubuntu-latest - steps: - - name: Dispatch event - run: | - http_status=$(curl -L -f -s -o /dev/null -w "%{http_code}" \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.DEPLOY_FLOW_WEBSITE }}" \ - https://api.github.com/repos/Flow-Launcher/flow-launcher.github.io/dispatches \ - -d '{"event_type":"deploy"}') - if [ "$http_status" -ne 204 ]; then echo "Error: Deploy trigger failed, HTTP status code is $http_status"; exit 1; fi From ec7ab007d044fd0f6bfad469c5628b284d3c7370 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Sun, 18 May 2025 22:23:10 +1000 Subject: [PATCH 2/2] fix typo --- .github/workflows/release_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_deploy.yml b/.github/workflows/release_deploy.yml index 028f0045af0..9e082b95fa4 100644 --- a/.github/workflows/release_deploy.yml +++ b/.github/workflows/release_deploy.yml @@ -31,4 +31,4 @@ jobs: -H "Authorization: Bearer ${{ secrets.Publish_Chocolatey }}" \ https://api.github.com/repos/Flow-Launcher/chocolatey-package/dispatches \ -d '{"event_type":"publish"}') - if [ "$http_status" -ne 204 ]; then echo "Error: Publish Chocolatey Packaged failed, HTTP status code is $http_status"; exit 1; fi + if [ "$http_status" -ne 204 ]; then echo "Error: Publish Chocolatey package failed, HTTP status code is $http_status"; exit 1; fi