-
-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (60 loc) · 1.91 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
name: Build and release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build-n-release:
name: Build and release
runs-on: ubuntu-latest
steps:
- name: Checkout workspace
uses: actions/checkout@master
with:
repository: lgc-LLDev/workspace-js
submodules: true
- name: Get package folder name
env:
REPO_NAME: ${{ github.event.repository.name }}
run: |
FOLDER_NAME=$(echo "${REPO_NAME}")
echo "FOLDER_NAME=${FOLDER_NAME}"
echo "FOLDER_NAME=${FOLDER_NAME}" >> $GITHUB_ENV
- name: Checkout current package submodule at specific commit
run: |-
cd plugins/${FOLDER_NAME}
git checkout ${{ github.sha }}
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Corepack
run: |-
npm install -g corepack
corepack enable
- name: Install Node dependencies
run: yarn
- name: Build and copy dist files to temp folder
run: |-
yarn build
yarn tsx scripts/copy-tooth-files.ts ${FOLDER_NAME}
- name: Deploy
uses: lgc2333/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: tooth-dist
FOLDER: github-release-tmp
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: 'upload dist [skip-ci]'
# SQUASH_HISTORY: true
- name: Get tooth version
run: |-
TOOTH_VERSION=$(yarn tsx scripts/read-version.ts ${FOLDER_NAME})
echo "TOOTH_VERSION=${TOOTH_VERSION}"
echo "TOOTH_VERSION=${TOOTH_VERSION}" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.TOOTH_VERSION }}
target_commitish: tooth-dist
make_latest: true
body: Release v${{ env.TOOTH_VERSION }}