0.1.0 #1
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 Package | |
on: | |
push: | |
tags: ['*'] | |
workflow_dispatch: | |
env: | |
NODE_VERSION: 20 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Write .npmrc file | |
run: | | |
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} > $HOME/.npmrc | |
echo @stagetimerio:registry=https://registry.npmjs.org/ >> $HOME/.npmrc | |
- name: Install Dependencies | |
run: npm ci --loglevel=error | |
- name: Compile TypeScript | |
run: npm run build | |
- name: Upload Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
- name: Setup Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Write .npmrc file | |
run: | | |
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} > $HOME/.npmrc | |
echo @stagetimerio:registry=https://registry.npmjs.org/ >> $HOME/.npmrc | |
- name: Install Dependencies | |
run: npm ci --loglevel=error | |
# Test step is commented out until tests are implemented | |
# But keeping the structure for future use | |
- name: Run Unit Tests | |
run: | | |
echo "No tests implemented yet" | |
exit 0 | |
# Uncomment when tests are available | |
# run: npm test | |
publish: | |
needs: test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
- name: Setup Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
registry-url: https://npm.pkg.github.com/ | |
- name: Publish Package | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |