0.72.0 #112
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
name: Publish @devcontainers/cli | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
scope: '@devcontainers' | |
- name: Verify Versions | |
run: | | |
node -e " | |
const packageRef = 'refs/tags/v' + require('./package.json').version; | |
const githubRef = '${{ github.ref }}'; | |
if (packageRef !== githubRef && packageRef + '-pre-release' != githubRef) { | |
console.log('::error::' + 'Version Mismatch.', packageRef, githubRef); | |
throw Error('Version Mismatch'); | |
} | |
" | |
- name: TGZ name | |
run: | | |
VERSION=$(jq -r '.version' < package.json) | |
echo "TGZ=devcontainers-cli-${VERSION}.tgz" | tee -a $GITHUB_ENV | |
echo "TGZ_UPLOAD=devcontainers-cli-${VERSION}-${GITHUB_SHA:0:8}.tgz" | tee -a $GITHUB_ENV | |
- name: Download TGZ | |
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe | |
with: | |
workflow: dev-containers.yml | |
workflow_conclusion: success | |
commit: ${{ github.sha }} | |
name: ${{ env.TGZ_UPLOAD }} | |
path: . | |
- name: Publish TGZ | |
run: npm publish ${TGZ} --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |