Add workflow

This commit is contained in:
Nick 2022-05-14 14:44:34 -04:00
parent ee9a7027b8
commit 8b002b5670
3 changed files with 37 additions and 4 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# Prevent paths like .gitignore, .gitattributes, etc from being archived in the release zip.
.* export-ignore

35
.github/workflows/create-release.yml vendored Normal file
View File

@ -0,0 +1,35 @@
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"
tag_name: "v${{fromJson(steps.read-manifest.outputs.manifest).version}}"

View File

@ -1,4 +0,0 @@
{
"enabled": true,
"settings": {}
}