Skip to content

Commit

Permalink
fix(release): fix dispatch action (#1339)
Browse files Browse the repository at this point in the history
**Related Ticket:** #1242 

I am sorry that I keep patching this action - it turned out that I
cannot use app token across the jobs 🙇
  • Loading branch information
hanbyul-here authored Dec 19, 2024
1 parent df72331 commit a1eb7fd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Release Every Other Monday
on:
workflow_dispatch:
inputs:
VERSION_NUMBER:
type: string
# Run action at 16:15 PM on Monday (UTC)
# schedule:
# @TODO: the schedule below is weekly. Do byweekly check.
Expand All @@ -13,21 +16,12 @@ permissions:
jobs:
release:
runs-on: ubuntu-latest
outputs:
VERSION_NUMBER: ${{ steps.git-release.outputs.VERSION_NUMBER }}
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PEM }}
owner: ${{ github.repository_owner }}
repositories: |
veda-ui
veda-config
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
Expand All @@ -37,17 +31,29 @@ jobs:
with:
node-version: ${{ env.NODE }}
- run: yarn
- run: yarn release --ci --verbose
- name: Release through Git
id: git-release
run: yarn release --ci --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
preview-build:
runs-on: ubuntu-latest
needs: "release"
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PEM }}
owner: ${{ github.repository_owner }}
repositories: |
veda-ui
veda-config
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.generate-token.outputs.token }}
token: ${{steps.generate-token.outputs.token}}
repository: nasa-impact/veda-config
event-type: update-version
client-payload: '{"ref": "${{ github.ref }}", "VERSION_NUMBER": "${{ env.VERSION_NUMBER }}"}'
client-payload: '{"ref": "${{ github.ref }}", "VERSION_NUMBER": "${{ needs.release.outputs.VERSION_NUMBER || inputs.VERSION_NUMBER }}"}'
4 changes: 2 additions & 2 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"hooks": {
"after:release": "echo \"VERSION_NUMBER=v${version}\" >> \"$GITHUB_ENV\" "
"after:release": "echo \"VERSION_NUMBER=v${version}\" >> \"$GITHUB_OUTPUT\" "
},
"plugins": {
"@release-it/conventional-changelog": {
Expand Down Expand Up @@ -28,4 +28,4 @@
"preRelease": false,
"draft": false
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@developmentseed/veda-ui",
"description": "Dashboard",
"version": "5.11.4",
"version": "5.11.3",
"author": {
"name": "Development Seed",
"url": "https://developmentseed.org/"
Expand Down

0 comments on commit a1eb7fd

Please sign in to comment.