-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.53 KB
/
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
# name: Build & Publish
on:
# push:
# branches:
# - main
jobs:
build-app:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: "Check release doesn't exist"
run: |
VERSION=$(jq -r '.Version' com.teddi.g502-battery-monitor.sdPlugin/manifest.json)
RESPONSE=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/tags/v$VERSION")
MESSAGE=$(echo $RESPONSE | jq -r '.message')
if [ "$MESSAGE" != "Not Found" ]; then
echo "Release v$VERSION already exists, please update the version in manifest.json"
exit 1
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
- uses: pnpm/action-setup@v3
with:
version: 8
run_install: true
- name: Build App
run: |
pnpm build
# Zip up the build artifact
- name: "Zip up the build artifact"
run: |
zip -r com.teddi.g502-battery-monitor.sdPlugin.zip com.teddi.g502-battery-monitor.sdPlugin
# Testing for the publish step
- name: "Publish to GitHub"
uses: softprops/action-gh-release@v1
with:
files: |
com.teddi.g502-battery-monitor.sdPlugin.zip
token: ${{ secrets.GITHUB_TOKEN }}
name: "v${{ steps.version.outputs.version }}"
body: "Release v${{ steps.version.outputs.version }}"
draft: false
prerelease: false