-
Notifications
You must be signed in to change notification settings - Fork 2
32 lines (32 loc) · 1017 Bytes
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Release
run-name: ${{ github.workflow }} ${{ github.event.inputs.release-version }}
on:
workflow_dispatch:
inputs:
release-version:
description: Enter version to release (e.g., 1.0.1).
required: false
jobs:
perform:
if: github.repository_owner == 'opendevise' && github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
environment: releases
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: Run tests
run: npm test
- name: Set up release environment
run: |
echo RELEASE_VERSION=${{ github.event.inputs.release-version }} >> $GITHUB_ENV
echo RELEASE_NPM_TOKEN=${{ secrets[format('NPM_TOKEN_{0}', github.actor)] }} >> $GITHUB_ENV
- name: Build, tag, and publish npm package
run: ./npm/release.sh