This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
fix type #13
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: Release Build | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
pull-requests: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get Release Version | |
id: getReleaseVersion | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/v} | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
registry-url: https://registry.npmjs.org/ | |
- name: Update NPM | |
run: npm install -g npm | |
- name: NPM Install | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
- name: Build | |
run: npm run build | |
- name: Upload vite-wrangler-spa package artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: vite-wrangler-spa | |
path: ./dist | |
publish-package: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
registry-url: https://registry.npmjs.org/ | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
- name: Update NPM | |
run: npm install -g npm | |
- name: Download vite-wrangler-spa artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: vite-wrangler-spa | |
path: dist | |
- name: List files | |
run: ls -lha | |
- name: Publish to NPM | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}} | |
## finalizing the release doesn't depend on Docs deploying because it fails frequently | |
finalize-release: | |
runs-on: ubuntu-latest | |
needs: publish-package | |
steps: | |
## Checkout so we can apply the new tag | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
## Documentation: https://github.com/marvinpinto/action-automatic-releases | |
- uses: 'marvinpinto/action-automatic-releases@latest' | |
with: | |
repo_token: '${{ secrets.GITHUB_TOKEN }}' | |
prerelease: false | |
# deploy-pages: | |
# environment: | |
# name: github-pages | |
# url: ${{ steps.deployment.outputs.page_url }} | |
# runs-on: ubuntu-latest | |
# needs: build | |
# steps: | |
# - name: Deploy to GitHub Pages | |
# id: deployment | |
# uses: actions/deploy-pages@v2 |