Skip to content

Commit

Permalink
chore: publish to website as other (#1126)
Browse files Browse the repository at this point in the history
<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it

This PR makes it so that the website publish becomes part of publish to
other because its technically an external repository that we dont want
to push in our core flow.

#### Which issue(s) this PR fixes
<!--
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Practically doesn't change anything except some cleanup and the
possibility to retrigger the job
  • Loading branch information
jakobmoellerdev authored Nov 25, 2024
1 parent 88d3ead commit f5a1cd2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/publish-to-other-than-github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,17 @@ jobs:
https://github.com/open-component-model/ocm/releases/download/v${{ env.RELEASE_VERSION }}/ocm-${{ env.RELEASE_VERSION }}-windows-arm64.zip `
--version ${{ env.RELEASE_VERSION }} `
Open-Component-Model.ocm-cli
push-to-website:
name: Update OCM Website
runs-on: ubuntu-latest
if: github.event.client_payload.push-to-website && github.event.client_payload.version != ''
steps:
- name: Ensure proper version
run: echo "RELEASE_VERSION=$(echo ${{ github.event.client_payload.version }})" >> $GITHUB_ENV
- name: Publish Release Event
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.generate_token.outputs.token }}
repository: open-component-model/ocm-website
event-type: ocm-cli-release
client-payload: '{"tag": "${{ env.RELEASE_VERSION }}"}'
13 changes: 2 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,25 +216,16 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make plain-push

- name: Publish Release Event
if: inputs.release_candidate == false
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.generate_token.outputs.token }}
repository: open-component-model/ocm-website
event-type: ocm-cli-release
client-payload: '{"tag": "${{ env.RELEASE_VERSION }}"}'

# now distribute the release event so that other jobs can listen for this
# and use the event to publish our release to other package registries
- name: Publish Release Event for other package registries
- name: Publish Release Event
if: inputs.release_candidate == false
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.generate_token.outputs.token }}
repository: ${{ github.repository_owner }}/ocm
event-type: publish-ocm-cli
client-payload: '{"version":"${{ env.RELEASE_VERSION }}","push-to-aur":true,"push-to-chocolatey":true,"push-to-winget":true,"push-to-brew-tap":true}'
client-payload: '{"version":"${{ env.RELEASE_VERSION }}","push-to-website":true,"push-to-aur":true,"push-to-chocolatey":true,"push-to-winget":true,"push-to-brew-tap":true}'

# make sure that the branch contains the next valid patch
bump-release-branch-pr:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/retrigger-publish-to-other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ on:
description: Do you want to push to the Homebrew Tap at https://github.com/open-component-model/homebrew-tap?
required: false
default: false
push-to-website:
type: boolean
description: Do you want to push an update to the OCM website?
required: false
default: false

jobs:
retrigger:
Expand Down Expand Up @@ -62,4 +67,4 @@ jobs:
token: ${{ steps.generate_token.outputs.token }}
repository: ${{ github.repository_owner }}/ocm
event-type: publish-ocm-cli
client-payload: '{"version":"${{ env.RELEASE_VERSION }}","push-to-aur":${{ github.event.inputs.push-to-aur }},"push-to-chocolatey":${{ github.event.inputs.push-to-chocolatey }},"push-to-winget":${{ github.event.inputs.push-to-winget }},"push-to-brew-tap":${{ github.event.inputs.push-to-brew-tap }}}'
client-payload: '{"version":"${{ env.RELEASE_VERSION }}","push-to-website":${{ github.event.inputs.push-to-website }},"push-to-aur":${{ github.event.inputs.push-to-aur }},"push-to-chocolatey":${{ github.event.inputs.push-to-chocolatey }},"push-to-winget":${{ github.event.inputs.push-to-winget }},"push-to-brew-tap":${{ github.event.inputs.push-to-brew-tap }}}'

0 comments on commit f5a1cd2

Please sign in to comment.