Skip to content

Commit ed6f850

Browse files
committed
Add prerelease.
1 parent 6f19db0 commit ed6f850

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/prerelease.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Pre Release
2+
3+
on:
4+
[push]
5+
jobs:
6+
build:
7+
8+
strategy:
9+
matrix:
10+
platform: [ubuntu-latest, macos-latest, windows-latest]
11+
node-version: [8.x, 10.x, 12.x]
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Use Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
- name: npm install, build, and test
20+
run: |
21+
npm ci
22+
npm run test:cov
23+
npm run build
24+
env:
25+
CI: true
26+
- name: Zip build
27+
run: |
28+
zip -r currentbuild.zip build
29+
- name: Deploy to gh-pages
30+
if: success()
31+
uses: crazy-max/ghaction-github-pages@v1
32+
with:
33+
target_branch: gh-pages
34+
build_dir: build
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Create Release
39+
id: create_release
40+
uses: actions/[email protected]
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
tag_name: ${{ github.ref }}
45+
release_name: Release ${{ github.ref }}
46+
draft: false
47+
prerelease: true
48+
49+
- name: Upload Release Asset
50+
id: upload-release-asset
51+
if: success()
52+
uses: actions/[email protected]
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
57+
asset_path: ./currentbuild.zip
58+
asset_name: currentbuild.zip
59+
asset_content_type: application/zip
60+

0 commit comments

Comments
 (0)