From bdb00d79e526eb1b627eabacfe4378594992aaeb Mon Sep 17 00:00:00 2001 From: Justin Pridgen Date: Mon, 10 Jun 2024 19:56:05 -0400 Subject: [PATCH] v1.4.9-beta.1 --- .github/workflows/build.yml | 53 ++++++++++++++++++++++++++++++++++++- mod.json | 2 +- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd0d369..ad0077f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,4 +54,55 @@ jobs: - uses: actions/upload-artifact@v4 with: name: Build Output - path: ${{ steps.build.outputs.build-output }} \ No newline at end of file + path: ${{ steps.build.outputs.build-output }} + draft: + name: Draft Release + runs-on: ubuntu-latest + needs: ['package'] + + steps: + - name: Delete Existing Release + uses: actions/github-script@v7 + env: + COMMIT_MESSAGE: ${{ github.event.head_commit.message }} + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const owner = process.env.GITHUB_REPOSITORY.split("/")[0]; + const repo = process.env.GITHUB_REPOSITORY.split("/")[1]; + const response = await github.rest.repos.listReleases({ owner, repo }); + console.log("Checking for existing release..."); + for (const release of response.data) { + if (release.tag_name == process.env.COMMIT_MESSAGE) { + console.log("Existing release found, deleting..."); + await github.rest.repos.deleteRelease({ owner, repo, release_id: release.id }); + await github.rest.git.updateRef({ + owner, + repo, + ref: `tags/${release.tag_name}`, + sha: context.sha, + force: true + }); + } + } + console.log("Done."); + + - name: Download Build Output + uses: actions/download-artifact@v4 + with: + name: Build Output + path: build-output + + - name: Create Draft Release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: | + build-output/*.geode + build-output/*.pdb + tag_name: ${{ github.event.head_commit.message }} + name: ${{ github.event.head_commit.message }} + draft: true + body: | + Replace with release notes diff --git a/mod.json b/mod.json index cb5db83..b1d19ae 100644 --- a/mod.json +++ b/mod.json @@ -1,5 +1,5 @@ { - "geode": "3.0.0-alpha.1", + "geode": "3.0.0-alpha.2", "gd": { "android": "2.206", "win": "2.206",