-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Release Obsidian plugin | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '21.x' | ||
|
||
- name: Build plugin | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Create release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
tag="${GITHUB_REF#refs/tags/}" | ||
gh release create "$tag" \ | ||
--title="$tag" \ | ||
build/main.js manifest.json styles.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Updating the version | ||
|
||
1. update pacakage.json version number | ||
2. npm run version (updates the manifest and version file) | ||
3. commit repo | ||
4. npm run githubaction (commits the version number tag to the repo and pushes it, which kicks of the github action to prepare the release) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { readFileSync, writeFileSync } from 'fs'; | ||
|
||
const targetVersion = process.env.npm_package_version; | ||
|
||
// read minAppVersion from manifest.json and bump version to target version | ||
let manifest = JSON.parse(readFileSync('manifest.json', 'utf8')); | ||
const { minAppVersion } = manifest; | ||
manifest.version = targetVersion; | ||
writeFileSync('manifest.json', JSON.stringify(manifest, null, '\t')); | ||
|
||
// update versions.json with target version and minAppVersion from manifest.json | ||
let versions = JSON.parse(readFileSync('versions.json', 'utf8')); | ||
versions[targetVersion] = minAppVersion; | ||
writeFileSync('versions.json', JSON.stringify(versions, null, '\t')); |