-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.69 KB
/
build-and-publish.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
name: Build & Publish Extension
on:
push:
branches: ["main", "devel"]
jobs:
build-retool-embedder:
name: "Build, Bundle, Release"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set short git commit SHA
id: vars
run: |
shortSha=$(git rev-parse --short ${{ github.sha }})
branch=$(git rev-parse --abbrev-ref HEAD)
zipfile=$(cat package.json | jq -r '"\(.name)-\(.version)"')
echo "COMMIT_SHORT_SHA=$shortSha" >> $GITHUB_ENV
echo "COMMIT_BRANCH=$branch" >> $GITHUB_ENV
echo "ZIP_FILE=$zipfile" >> $GITHUB_ENV
- name: Confirm env.COMMIT_SHORT_SHA
run: "echo 'env.COMMIT_SHORT_SHA === ${{ env.COMMIT_SHORT_SHA }}'"
- name: Confirm env.COMMIT_BRANCH
run: "echo 'env.COMMIT_BRANCH === ${{ env.COMMIT_BRANCH }}'"
- name: Confirm env.ZIP_FILE
run: "echo 'env.ZIP_FILE === ${{ env.ZIP_FILE }}'"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Build Extension
run: |-
npm ci
npm run build
- name: Archive retool-embedder Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.ZIP_FILE }}
path: ${{ env.ZIP_FILE }}.zip
- name: Create and publish release
uses: ncipollo/release-action@v1
with:
tag: "ci-${{ env.COMMIT_BRANCH }}-${{ env.COMMIT_SHORT_SHA }}"
commit: ${{ env.COMMIT_BRANCH }}
artifacts: "${{ env.ZIP_FILE }}.zip"
body: "# Retool Embedder - CI Build\n## ${{ env.ZIP_FILE }}.zip"