-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (45 loc) · 1.77 KB
/
release.yml
File metadata and controls
55 lines (45 loc) · 1.77 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
name: Build Release
on:
workflow_dispatch:
push:
tags:
- v*
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: get name
id: name
uses: notiz-dev/github-action-json-property@7c8cf5cc36eb85d8d287a8086a39dac59628eb31
with:
path: "package.json"
prop_path: "name"
- name: get version
id: version
uses: notiz-dev/github-action-json-property@7c8cf5cc36eb85d8d287a8086a39dac59628eb31
with:
path: "package.json"
prop_path: "version"
- name: Set Environment Variables
run: |
echo "repositoryName=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}" >> $GITHUB_ENV
echo "majorVersionValue=`echo ${{ steps.version.outputs.prop }} | cut -d '.' -f 1`" >> $GITHUB_ENV
echo "zipFile=${{ steps.name.outputs.prop }}-${{ steps.version.outputs.prop }}.zip" >> $GITHUB_ENV
- name: Create Zip
run: zip -r "$ZIP_NAME" . -x '.*'
env:
ZIP_NAME: "${{env.zipFile}}"
- name: Create VPAI Package
run: curl -sL "https://api.anatawa12.com/create-vpai/?repo=https%3A%2F%2Fsayabeans.github.io%2Fvpm%2Findex.json&package=${{ steps.name.outputs.prop }}&version=${{ env.majorVersionValue }}.x.x" > ${{ env.repositoryName }}-${{ env.majorVersionValue }}.x.x-installer.unitypackage
- name: Make Release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
with:
tag_name: v${{ steps.version.outputs.prop }}
files: |
${{ env.zipFile }}
${{ env.repositoryName }}-${{ env.majorVersionValue }}.x.x-installer.unitypackage
package.json