From 37bce62af5592d2859f7098501de730a57304c7c Mon Sep 17 00:00:00 2001 From: DC23 Date: Wed, 27 Nov 2024 21:05:34 +1100 Subject: [PATCH 1/2] First commit of release drafter workflow #76 --- .github/release-drafter.yml | 22 +++++++++++++++++ .github/workflows/release-drafter.yml | 35 +++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..5ad6fcd --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,22 @@ +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - 'core feature' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' + labels: + - 'refactoring' + - 'maintenance' + - title: '📖 Documentation' + labels: + - 'documentation' +template: | + ## What's Changed + + $CHANGES \ No newline at end of file diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..888e344 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,35 @@ +name: Release Drafter + +on: + # workflow_dispatch allows manual runs so the release notes can be rebuilt after PRs are renamed or relabeled + workflow_dispatch: + push: + # branches to consider in the event; optional, defaults to all + branches: + - main + # pull_request event is required only for autolabeler + pull_request: + # Only following types are handled by the action, but one can default to all as well + types: [opened, reopened, synchronize] + +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + # write permission is required to create a github release + contents: write + # write permission is required for autolabeler + # otherwise, read permission is required at least + pull-requests: read + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into main + - uses: release-drafter/release-drafter@v6 + # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml + # with: + # config-name: my-config.yml + # disable-autolabeler: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 87f63a61079f4b8a8f604647223389afeeaeea9e Mon Sep 17 00:00:00 2001 From: DC23 Date: Wed, 27 Nov 2024 21:21:44 +1100 Subject: [PATCH 2/2] first commit of release creation workflow --- .github/workflows/release-creation.yml | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/release-creation.yml diff --git a/.github/workflows/release-creation.yml b/.github/workflows/release-creation.yml new file mode 100644 index 0000000..f3bc4ba --- /dev/null +++ b/.github/workflows/release-creation.yml @@ -0,0 +1,42 @@ +name: Release Creation + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + # Substitute the Manifest and Download URLs in the system.json + - name: Substitute Manifest and Download Links For Versioned Ones + id: sub_manifest_link_version + uses: microsoft/variable-substitution@v1 + with: + files: 'system.json' + env: + version: ${{github.event.release.tag_name}} + url: https://github.com/${{github.repository}} + manifest: https://github.com/${{github.repository}}/releases/latest/download/system.json + download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}.zip + + # Create a zip file with all files required by the module to add to the release + - run: zip -r ./${{github.event.release.tag_name}}.zip system.json template.json LICENSE lang/ module/ styles/ templates/ + + # Create a release for this specific version + - name: Update Release with Files + id: create_version_release + uses: ncipollo/release-action@v1.12.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + name: ${{ github.event.release.name }} + allowUpdates: true # Set this to false if you want to prevent updating existing releases + draft: true + prerelease: false + artifacts: './system.json, ./${{ github.event.release.tag_name }}.zip' + tag: ${{ github.event.release.tag_name }} + body: ${{ github.event.release.body }}