This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (90 loc) · 2.57 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release Build
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
# 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
- 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