Release 0.16.3 #257
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
name: Build obsidian plugin | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
id: build | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: git config --global url."[email protected]:".insteadOf https://github.com/ | |
- run: git config --global url."git://".insteadOf https:// | |
- run: npm ci | |
- run: npm run build --if-present | |
- run: cp ./styles.css ./obsidian_local_images_plus_latest/styles.css | |
- run: zip -r obsidian_local_images_plus_latest.zip ./obsidian_local_images_plus_latest | |
shell: bash | |
- run: echo "tag_name=$( grep -i '\"version\"' manifest.json | sed -e 's,:, ,g' -e 's,\",,g' -e 's,\,,,g' -e 's,.* ,,g' )" >> $GITHUB_ENV | |
shell: bash | |
- run: echo ${{ env.tag_name }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.tag_name }} | |
release_name: ${{ env.tag_name }} | |
draft: false | |
prerelease: false | |
# - run: echo "tag_name=$(git tag --sort version:refname | tail -n 1)" >> $GITHUB_OUTPUT | |
# - run: echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)" | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./obsidian_local_images_plus_latest.zip | |
asset_name: obsidian_local_images_plus_latest-${{ env.tag_name }}.zip | |
asset_content_type: application/zip | |
- name: Upload Release Asset | |
id: upload-release-asset2 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./styles.css | |
asset_name: styles.css | |
asset_content_type: text/javascript | |
- name: Upload Release Asset | |
id: upload-release-asset3 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./manifest.json | |
asset_name: manifest.json | |
asset_content_type: application/json | |
- name: Upload Release Asset | |
id: upload-release-asset4 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./obsidian_local_images_plus_latest/main.js | |
asset_name: main.js | |
asset_content_type: text/javascript | |