generated from Outer-Wilds-New-Horizons/nh-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (30 loc) · 1.22 KB
/
create-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
name: Create Release
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo files
uses: actions/checkout@v2
- name: Create zip with repo files
run: git archive --format zip --output ${{ github.event.repository.name }}.zip HEAD
- name: Read checked out manifest.json
id: read-manifest
run: echo "::set-output name=manifest::$(< ./manifest.json sed ':a;N;$!ba;s/\n/ /g')"
- name: Check if version in manifest.json is already released
uses: mukunku/tag-exists-action@v1.0.0
id: checkTag
with:
tag: "v${{fromJson(steps.read-manifest.outputs.manifest).version}}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish repo zip with version from manifest
if: ${{ (fromJson(steps.read-manifest.outputs.manifest).version != '0.0.0') && (steps.checkTag.outputs.exists == 'false') }}
uses: softprops/action-gh-release@v1
with:
files: "${{ github.event.repository.name }}.zip"
body: "${{ github.event.head_commit.message }}"
tag_name: "v${{fromJson(steps.read-manifest.outputs.manifest).version}}"