dev-arm64-test #12
Workflow file for this run
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
# Copyright 2022 Google LLC | |
# | |
# Use of this source code is governed by a BSD-style | |
# license that can be found in the LICENSE file or at | |
# https://developers.google.com/open-source/licenses/bsd | |
# A workflow to release Shaka Packager to NPM. | |
name: NPM Release | |
# Runs when a new release is published on GitHub. | |
# Creates a corresponding NPM release and publishes it. | |
# | |
# Can also be run manually for debugging purposes. | |
on: | |
release: | |
types: [published] | |
# For manual debugging: | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: "The tag to release to NPM." | |
required: True | |
jobs: | |
publish_npm: | |
name: Publish to NPM | |
runs-on: ubuntu-latest | |
steps: | |
- name: Compute ref | |
id: ref | |
# We could be building from a workflow dispatch (manual run), or a | |
# release event. Subsequent steps can refer to $TARGET_REF to | |
# determine the correct ref in all cases. | |
run: | | |
echo "TARGET_REF=${{ github.event.inputs.ref || github.event.release.tag_name }}" >> $GITHUB_ENV | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.TARGET_REF }} | |
- name: Setup NodeJS | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 10 | |
- name: Set package name and version | |
run: | | |
cd npm | |
sed package.json -i \ | |
-e 's/"name": ""/"name": "${{ secrets.NPM_PACKAGE_NAME }}"/' \ | |
-e 's/"version": ""/"version": "${{ env.TARGET_REF }}"/' | |
- name: Publish NPM package | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_CI_TOKEN }} | |
package: npm/package.json | |
check-version: false | |
access: public |