-
Notifications
You must be signed in to change notification settings - Fork 51
65 lines (52 loc) · 1.96 KB
/
release-stub.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
# Creates a Site Template Stub Release
name: Build and release Stub
on:
workflow_dispatch:
jobs:
build_and_release:
name: Build and release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/setup-node@v1
with:
node-version: '16'
- name: Install NPM dependencies
run: npm install
- name: Build Site Template Stub
run: npm run stub
- name: Read package.json
id: package
uses: juliangruber/read-file-action@v1
with:
path: ./package.json
- name: Extract name and version from package.json
id: packageJson
run: |
echo ::set-output name=NAME::$(echo '${{ steps.package.outputs.content }}' | jq -r '.name')
echo ::set-output name=VERSION::$(echo '${{ steps.package.outputs.content }}' | jq -r '.version')
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.packageJson.outputs.NAME }}-${{ steps.packageJson.outputs.VERSION }}-stub
release_name: ${{ steps.packageJson.outputs.NAME }}-stub-${{ steps.packageJson.outputs.VERSION }}
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.packageJson.outputs.NAME }}-${{ steps.packageJson.outputs.VERSION }}-stub.zip
asset_name: ${{ steps.packageJson.outputs.NAME }}-${{ steps.packageJson.outputs.VERSION }}-stub.zip
asset_content_type: application/zip