-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (46 loc) · 1.27 KB
/
release.yml
File metadata and controls
59 lines (46 loc) · 1.27 KB
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
name: Release Latest Build
on:
push:
branches:
- main
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Remove old files
run: |
rm -rf dist
mkdir dist
- name: Build project
run: npm run build
- name: Clean up source files
run: |
find . -mindepth 1 -maxdepth 1 ! -name 'dist' ! -name '.git' -exec rm -rf {} +
- name: Copy files from dist
run: |
mv dist/* .
rmdir dist
- name: Version File
run: |
date +%s > version
- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout --orphan latest-release
- name: Commit and push changes
run: |
git add .
git commit -m "Latest build $(date "+%Y-%m-%d %H:%M:%S")"
git push -f origin latest-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}