Release 1.2.1 #9
Workflow file for this run
This file contains hidden or 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: Publish to npm | |
on: | |
release: | |
types: [published] | |
jobs: | |
publish: | |
if: github.actor == 'badabing2005' | |
runs-on: ubuntu-latest | |
name: Publish to npm | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Download Release Assets | |
id: download_assets | |
run: | | |
mkdir -p ./publish | |
tag_name=${{ github.event.release.tag_name }} | |
asset_name="joplin-plugin-insert-youtube-video_${tag_name}.zip" | |
echo "ASSET_NAME=$asset_name" >> $GITHUB_ENV | |
release_info=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/${tag_name}") | |
asset_id=$(echo "$release_info" | jq -r ".assets[] | select(.name == \"$asset_name\") | .id") | |
echo "Asset ID: $asset_id" | |
download_url=$(echo "$release_info" | jq -r ".assets[] | select(.id == $asset_id) | .browser_download_url") | |
echo "Download URL: $download_url" | |
curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -o ./publish/$asset_name "$download_url" | |
ls -lR ./publish | |
- name: Unzip Artifacts | |
run: | | |
cd publish | |
unzip ${{ env.ASSET_NAME }} -d . | |
rm -f ${{ env.ASSET_NAME }} | |
ls -l | |
cd .. | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Set npm Registry URL | |
run: npm config set registry https://registry.npmjs.org/ | |
- name: Set npm Auth Token | |
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} | |
- name: Debug NPM Config | |
run: npm config ls | |
- name: Publish to npm | |
run: npm publish |