Skip to content

Commit

Permalink
add beta deploy job
Browse files Browse the repository at this point in the history
  • Loading branch information
uphy committed Feb 4, 2024
1 parent aab7e4a commit 67589e7
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 81 deletions.
81 changes: 0 additions & 81 deletions .github/workflows/publish.yml

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Release - beta

on:
workflow_dispatch:
inputs:
version:
description: "The beta version of the plugin e.g. 1.0.0-beta.1"
required: true

env:
PLUGIN_NAME: obsidian-reminder

jobs:
release-beta:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
ref: master
- uses: actions/checkout@v2
with:
ref: develop
- name: Update the versions
env:
GH_TOKEN: ${{ github.token }}
run: |
version=${{ github.event.inputs.version }}
echo "RELEASE_VERSION=$version" >> $GITHUB_ENV
# update manifest version
sed -i "s/\"version\": \".*\"/\"version\": \"$version\"/" manifest-beta.json
# commit and push the changes
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add manifest-beta.json
git commit -m "Update the version to $version"
git push origin develop
git tag $version
git push --tags
# cherry pick the manifest change to master
git checkout -b release-beta-$version origin/master
git cherry-pick $version
git push origin release-beta-$version
gh pr create -B master -t "Release $version" -b ""
# go back to develop
git checkout develop
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "16.x" # You might need to adjust this value to your own version
- name: Build
id: build
run: |
npm ci
npm run build
mkdir ${{ env.PLUGIN_NAME }}
cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_VERSION }}
name: ${{ env.RELEASE_VERSION }}
draft: false
prerelease: true
files: |
${{ env.PLUGIN_NAME }}.zip
main.js
manifest.json
styles.css
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "The version of the plugin e.g. 1.0.0"
required: true

env:
PLUGIN_NAME: obsidian-reminder

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
ref: master
- name: Update the versions
run: |
version=${{ github.event.inputs.version }}
echo "RELEASE_VERSION=$version" >> $GITHUB_ENV
# update manifest version
sed -i "s/\"version\": \".*\"/\"version\": \"$version\"/" manifest.json
# commit and push the changes
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add manifest.json
git commit -m "Update the version to $version"
git push origin master
git tag $version
git push --tags
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "16.x" # You might need to adjust this value to your own version
- name: Build
id: build
run: |
npm ci
npm run build
mkdir ${{ env.PLUGIN_NAME }}
cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_VERSION }}
name: ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false
files: |
${{ env.PLUGIN_NAME }}.zip
main.js
manifest.json
styles.css
10 changes: 10 additions & 0 deletions manifest-beta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "obsidian-reminder-plugin",
"name": "Reminder",
"version": "1.1.15",
"minAppVersion": "1.0.3",
"description": "Reminder plugin for Obsidian. This plugin adds feature to manage TODOs with reminder.",
"author": "uphy",
"authorUrl": "https://obsidian.md/about",
"isDesktopOnly": false
}

0 comments on commit 67589e7

Please sign in to comment.