From ae89605cee523a43c5add6836811e8c4a54f6342 Mon Sep 17 00:00:00 2001 From: Pawel Date: Sun, 23 Jun 2024 01:41:43 +0200 Subject: [PATCH] Automatically build zip and create Github release --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..67f22516 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: zip-and-release +on: [ push ] +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: checkout repository + uses: actions/checkout@v4 + + - name: Extract datapack version + run: | + version=$(awk '/DATAPACK VERSION NUMBER/ { print $5 }' "Brilliance Datapack/data/do2/functions/version.mcfunction") + echo "BRILLIANCE_VERSION=${version}" >> "$GITHUB_ENV" + + - name: Create zip + run: cd "Brilliance Datapack" && zip -r brilliance-datapack.zip . + + - name: Create Github release + uses: softprops/action-gh-release@v2 + if: github.ref == 'refs/heads/main' + with: + make_latest: true + tag_name: ${{ env.BRILLIANCE_VERSION }} + files: | + Brilliance Datapack/brilliance-datapack.zip