-
Notifications
You must be signed in to change notification settings - Fork 24
82 lines (69 loc) · 2.35 KB
/
web-ui-automation.yaml
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
# This is a CI for Prysm Web UI
name: Prysm Web CI
# Specify tags allowed
on:
push:
tags:
- '*'
jobs:
# Build job for Prysm Web ui
build_and_release:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Automated steps for the release
steps:
- uses: actions/checkout@v2
with:
path: main
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "16.x"
path: main
- name: Install dependencies
run: cd main && npm install
- name: Node build step for prod
run: cd main && npm run build:prod
- name: Archive the release
run: cd main/dist && tar -czvf ../prysm-web-ui.tar.gz .
- name: Create shasum
run: cd main && shasum -a 256 prysm-web-ui.tar.gz | awk '{print $1}' > prysm-web-ui.tar.gz.sha256sum
- name: Define shasum variable
id: new_shasum
run: cd main && echo "::set-output name=SHA::$(cat prysm-web-ui.tar.gz.sha256sum)"
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: Release-${{ github.ref }}
tag_name: ${{ github.ref }}
body_path: ./main/CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload archived artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./main/prysm-web-ui.tar.gz
asset_name: prysm-web-ui.tar.gz
asset_content_type: application/gzip
- name: Upload checksum artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./main/prysm-web-ui.tar.gz.sha256sum
asset_name: prysm-web-ui.tar.gz.sha256sum
asset_content_type: application/sha256sum
- name: Get previous tag version
id: previous_version
run: cd main && echo "::set-output name=TAG_NAME::$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)"
outputs:
new_sha: ${{ steps.new_shasum.outputs.SHA }}
old_tag: ${{ steps.previous_version.outputs.TAG_NAME }}