Skip to content

Commit

Permalink
add support for manifest-beta on other branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Aug 11, 2024
1 parent 613033a commit 95143c7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/obsidian-plugin-bump-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ on:
jobs:
echo:
runs-on: ubuntu-latest

steps:
- name: Echo
run: |
Expand All @@ -69,6 +68,7 @@ jobs:
VERSION: ""
CHANGELOG: ""
STYLE: false
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
runs-on: ubuntu-latest
steps:
- name: Verify Inputs for cache
Expand Down Expand Up @@ -210,6 +210,7 @@ jobs:
VERSION: ""
CHANGELOG: ""
STYLE: false
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
runs-on: ubuntu-latest
steps:
- name: Verify inputs for cache
Expand Down Expand Up @@ -301,6 +302,16 @@ jobs:
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Update manifest-beta.json in main branch
if: ${{ format('refs/heads/{0}', github.event.repository.default_branch) != env.BRANCH_NAME }}
run: |
git checkout ${{ github.event.repository.default_branch }}
git pull
npx rexreplace "version\": \".*?\"" "version\": \"$VERSION\"" -s -M -G -m -o "manifest-beta.json"
git add manifest-beta.json
git commit -m "Update manifest-beta.json"
git push
- name: Create Release with css
if: ${{ fromJson(env.STYLE) && !env.ACT }}
uses: softprops/action-gh-release@v1
Expand All @@ -320,7 +331,7 @@ jobs:
${{ inputs.PLUGIN_NAME }}/manifest.json
${{ inputs.PLUGIN_NAME }}/styles.css
- name: Create Release without css
if: ${{ !fromJson(inputs.STYLE) && !env.ACT }}
if: ${{ !fromJson(env.STYLE) && !env.ACT }}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/obsidian-plugin-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
TAG_BETA: ""
STYLE: false
BETA_BUILD: ""
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Verify inputs
if: ${{ inputs.CACHE != 'npm' && inputs.CACHE != 'pnpm' && inputs.CACHE != 'yarn' && inputs.CACHE != 'bun'}}
Expand Down Expand Up @@ -122,6 +123,15 @@ jobs:
zip -r ${{ inputs.PLUGIN_NAME }}.zip ${{ inputs.PLUGIN_NAME }}
echo "### Files" >> $GITHUB_STEP_SUMMARY
ls >> $GITHUB_STEP_SUMMARY
- name: Update manifest-beta.json in main branch
if: ${{ fromJson(env.PRERELEASE) && format('refs/heads/{0}', github.event.repository.default_branch) != env.BRANCH_NAME }}
run: |
git checkout ${{ github.event.repository.default_branch }}
git pull
npx rexreplace "version\": \".*?\"" "version\": \"$VERSION\"" -s -M -G -m -o "manifest-beta.json"
git add manifest-beta.json
git commit -m "Update manifest-beta.json"
git push
- name: Delete release if workflow dispatch
if: ${{ github.event_name == 'workflow_dispatch' && !env.ACT }}
continue-on-error: true
Expand Down

0 comments on commit 95143c7

Please sign in to comment.