-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.89 KB
/
Copy pathPublicPackage.yml
File metadata and controls
65 lines (55 loc) · 1.89 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
59
60
61
62
63
64
65
name: Publish UPM Package
on:
push:
branches:
- main
paths:
- 'package.json'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# Step 1: Check out the repository
- name: Check out code
uses: actions/checkout@v4
# Step 2: Setup Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
# Step 3: Extract version for Tagging
- name: Extract Version
id: get_version
run: |
VERSION=$(grep '"version":' package.json | cut -d'"' -f4)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
shell: bash
# Step 4: Run npm pack
- name: Pack Package
id: pack
run: |
# npm pack creates a .tgz file and outputs the name to the console
FILENAME=$(npm pack)
echo "PACKAGE_FILENAME=$FILENAME" >> $GITHUB_ENV
echo "Created package: $FILENAME"
shell: bash
# Step 5: Create Release and Upload the .tgz
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.get_version.outputs.VERSION }}
name: "Release ${{ steps.get_version.outputs.VERSION }}"
body: |
## Node Graph Editor ${{ steps.get_version.outputs.VERSION }}
Automated release from `main` branch update.
### Installation
- **Git URL:** `https://github.com/Selva1910/NodeGraphEditor.git#v${{ steps.get_version.outputs.VERSION }}`
- **Tarball:** Download the `.tgz` below and "Add package from tarball" in Unity.
---
*Author: Selvaraj Balakrishnan*
*License: AGPLv3 (Attribution Required)*
files: ${{ env.PACKAGE_FILENAME }}
draft: false
prerelease: false