Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan selected folders instead of all #455

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build

env:
PLUGIN_NAME: obsidian-to-anki-plugin

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
install-exact: [1, 0]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# obsidian package often fails integrity checks since its a tarball, hence will get the get the tarball -> npm will cache it -> npm ci will test integrity of that cache vs package-lock.json
# https://github.com/ShootingKing-AM/Obsidian_to_Anki/pull/122
# Installing exact tree would be used in CI/CD to exactly reproduce tests
- name: Node install exact tree
if: matrix.install-exact == 1
run: |
npm install obsidian
npm ci

# Install latest tree would be usually done by devs/who locally build the plugin
- name: Node install latest tree
if: matrix.install-exact == 0
run: |
npm update
npm install
- run: npm run build --if-present
# - run: npm test

- name: Package
run: |
mkdir ${{ env.PLUGIN_NAME }}
cp main.js manifest.json styles.css README.md ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}
path: |
${{ env.PLUGIN_NAME }}.zip

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"

gh release create "$tag" \
--title="$tag" \
--draft \
main.js manifest.json styles.css
Loading