generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 9.08
- 9.05
- 9.02
- 0.9.219
- 0.9.217
- 0.9.216
- 0.9.215
- 0.9.214
- 0.9.213
- 0.9.212
- 0.9.211
- 0.9.209
- 0.9.208
- 0.9.207
- 0.9.206
- 0.9.205
- 0.9.204
- 0.9.203
- 0.9.202
- 0.9.201
- 0.9.159
- 0.9.158
- 0.9.157
- 0.9.156
- 0.9.155
- 0.9.154
- 0.9.153
- 0.9.152
- 0.9.151
- 0.9.150
- 0.9.149
- 0.9.148
- 0.9.147
- 0.9.146
- 0.9.145
- 0.9.143
- 0.9.142
- 0.9.141
- 0.9.115
- 0.9.091
- 0.9.071
- 0.9.21
- 0.9.20
- 0.9.14
- 0.9.13
- 0.9.12
- 0.9.11
- 0.9.10
- 0.9.09
- 0.9.08
- 0.9.07
- 0.9.06
- 0.9.04
- 0.9.03
- 0.9.01
- 0.9
- 0.8.133
- 0.8.132
- 0.8.122
- 0.8.121
- 0.8.13
- 0.8.12
- 0.8.11
1 parent
61c35ff
commit 4cacdef
Showing
3 changed files
with
83 additions
and
156 deletions.
There are no files selected for viewing
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,82 +1,91 @@ | ||
name: Build obsidian plugin | ||
|
||
name: Release Obsidian Plugin | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- "*" # Push events to matching any tag format, i.e. 1.0, 20.15.10 | ||
|
||
env: | ||
PLUGIN_NAME: bibnotes # Change this to the name of your plugin-id folder | ||
|
||
- '*' # Push events to matching any tag format, i.e. 1.0, 20.15.10 | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "14.x" # You might need to adjust this value to your own version | ||
- name: Build | ||
id: build | ||
run: | | ||
yarn | ||
yarn run build --if-present | ||
mkdir ${{ env.PLUGIN_NAME }} | ||
cp main.js manifest.json ${{ env.PLUGIN_NAME }} | ||
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }} | ||
ls | ||
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)" | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ github.ref }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload zip file | ||
id: upload-zip | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./${{ env.PLUGIN_NAME }}.zip | ||
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip | ||
asset_content_type: application/zip | ||
- name: Upload main.js | ||
id: upload-main | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./main.js | ||
asset_name: main.js | ||
asset_content_type: text/javascript | ||
- name: Upload manifest.json | ||
id: upload-manifest | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./manifest.json | ||
asset_name: manifest.json | ||
asset_content_type: application/json | ||
# - name: Upload styles.css | ||
# id: upload-css | ||
# uses: actions/upload-release-asset@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
# asset_path: ./styles.css | ||
# asset_name: styles.css | ||
# asset_content_type: text/css | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | ||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '14.x' # You might need to adjust this value to your own version | ||
# Get the version number and put it in a variable | ||
- name: Get Version | ||
id: version | ||
run: | | ||
echo "::set-output name=tag::$(git describe --abbrev=0)" | ||
# Build the plugin | ||
- name: Build | ||
id: build | ||
run: | | ||
npm install | ||
npm run build --if-present | ||
# Package the required files into a zip | ||
- name: Package | ||
run: | | ||
mkdir ${{ github.event.repository.name }} | ||
cp main.js manifest.json styles.css README.md ${{ github.event.repository.name }} | ||
zip -r ${{ github.event.repository.name }}.zip ${{ github.event.repository.name }} | ||
# Create the release on github | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ github.ref }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
# Upload the packaged release file | ||
- name: Upload zip file | ||
id: upload-zip | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./${{ github.event.repository.name }}.zip | ||
asset_name: ${{ github.event.repository.name }}-${{ steps.version.outputs.tag }}.zip | ||
asset_content_type: application/zip | ||
# Upload the main.js | ||
- name: Upload main.js | ||
id: upload-main | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./main.js | ||
asset_name: main.js | ||
asset_content_type: text/javascript | ||
# Upload the manifest.json | ||
- name: Upload manifest.json | ||
id: upload-manifest | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./manifest.json | ||
asset_name: manifest.json | ||
asset_content_type: application/json | ||
# Upload the style.css | ||
- name: Upload styles.css | ||
id: upload-css | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./styles.css | ||
asset_name: styles.css | ||
asset_content_type: text/css | ||
# TODO: release notes??? |