Merge pull request #5 from Minecraft633/patch-1 #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
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 "manifest=$(< ./manifest.json sed ':a;N;$!ba;s/\n/ /g')" >> $GITHUB_OUTPUT | |
- name: Check For Release | |
id: checkTag | |
run: echo "exists=$(git ls-remote --exit-code --tags origin ${{ env.TAG }} >/dev/null 2>&1 && echo true || echo false)" >> $GITHUB_OUTPUT | |
env: | |
TAG: "v${{fromJson(steps.read-manifest.outputs.manifest).version}}" | |
- name: Create Release | |
uses: "ncipollo/release-action@v1" | |
if: ${{ (fromJson(steps.read-manifest.outputs.manifest).version != '0.0.0') && (steps.checkTag.outputs.exists == 'false') }} | |
with: | |
allowUpdates: true | |
commit: ${{ github.ref_name }} | |
tag: "v${{fromJson(steps.read-manifest.outputs.manifest).version}}" | |
name: Version ${{fromJson(steps.read-manifest.outputs.manifest).version}} | |
omitBodyDuringUpdate: true | |
artifacts: "${{ github.event.repository.name }}.zip" | |
draft: true | |
prerelease: false |