From abb1730a8840a5ce6348c979a2b50958794d4b28 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 25 May 2024 14:57:55 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=E2=9C=8F=20Update=20PR=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/pull_request_template.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f4a641b3eb..49e686251c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,4 +1,7 @@ -*Thank you for contributing to Dashy! So that your PR can be handled effectively, please populate the following fields (delete sections that are not applicable)* + **Category**: > One of: Bugfix / Feature / Code style update / Refactoring Only / Build related changes / Documentation / Other (please specify) @@ -20,5 +23,5 @@ - [ ] There are no (new) build warnings or errors - [ ] _(If a new config option is added)_ Attribute is outlined in the schema and documented - [ ] _(If a new dependency is added)_ Package is essential, and has been checked out for security or performance -- [ ] Bumps version, if new feature added +- [ ] _(If significant change)_ Bumps version in package.json From d2b68fbd58b3df09b455111a32109f941802183d Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 25 May 2024 14:58:27 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=94=A8=20Add=20a=20workflow=20to=20au?= =?UTF-8?q?to=20tag=20when=20new=20version=20made?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-tag-pr.yml | 44 ------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 .github/workflows/auto-tag-pr.yml diff --git a/.github/workflows/auto-tag-pr.yml b/.github/workflows/auto-tag-pr.yml deleted file mode 100644 index d3a575bdd1..0000000000 --- a/.github/workflows/auto-tag-pr.yml +++ /dev/null @@ -1,44 +0,0 @@ -# Creates a new tag, whenever the app version (in package.json) is updated in master -# And marks any relevant issues as fixed -name: ๐Ÿ—๏ธ Release Tag new Versions -on: - push: - branches: - - master -jobs: - tag-pre-release: - runs-on: ubuntu-latest - permissions: - contents: write - outputs: - tag: ${{ steps.autotag.outputs.tagname }} - steps: - - uses: actions/checkout@v2 - - uses: butlerlogic/action-autotag@stable - id: autotag - with: - GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - strategy: package - commit_message_template: "๐Ÿ”– {{number}} {{message}} (by {{author}})\nSHA: {{sha}}\n." - github-release: - runs-on: ubuntu-latest - needs: tag-pre-release - if: ${{ needs.tag-pre-release.outputs.tag }} - steps: - - uses: actions/checkout@v2 - - uses: ncipollo/release-action@v1 - env: - GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - with: - tag: ${{ needs.tag-pre-release.outputs.tag }} - bodyFile: ".github/LATEST_CHANGELOG.md" - mark-issue-fixed: - runs-on: ubuntu-latest - if: ${{ github.event_name == 'issues' }} - steps: - - uses: actions/checkout@v2 - - name: Label Fixed Issues - uses: gh-bot/fix-labeler@master - with: - token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - label: 'โœ… Fixed' From 86adcbd8ddccaf7e0273ee208ff4aaa9fe40bb5b Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 25 May 2024 14:58:43 +0100 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=A8=20Update=20docker=20workflow,?= =?UTF-8?q?=20to=20only=20publish=20tag=20when=20new?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-build-publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build-publish.yml b/.github/workflows/docker-build-publish.yml index 851298c041..20e190abf5 100644 --- a/.github/workflows/docker-build-publish.yml +++ b/.github/workflows/docker-build-publish.yml @@ -1,11 +1,10 @@ -# Scans, builds and releases a multi-architecture docker image name: ๐Ÿณ Build + Publish Multi-Platform Image on: workflow_dispatch: push: branches: ['master'] - tags: [v*] + tags: ['v*'] paths: - '**.js' - 'src/**' @@ -48,7 +47,7 @@ jobs: ghcr.io/${{ env.GH_IMAGE }} tags: | type=ref,event=tag,prefix=release-,suffix={{tag}} - type=semver,pattern={{raw}},value=${{ steps.package-version.outputs.version }} + type=semver,pattern={{major}}.x,value=${{ steps.package-version.outputs.version }} labels: | maintainer=Lissy93 org.opencontainers.image.title=Dashy From 17fa29c54f77a1cefcc90d55f80229b6e40f4f48 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 25 May 2024 14:59:12 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=A8=20Add=20a=20workflow=20to=20au?= =?UTF-8?q?to=20tag=20when=20new=20version=20made?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/create-tag-for-version.yml | 55 ++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/create-tag-for-version.yml diff --git a/.github/workflows/create-tag-for-version.yml b/.github/workflows/create-tag-for-version.yml new file mode 100644 index 0000000000..e20cb5d33e --- /dev/null +++ b/.github/workflows/create-tag-for-version.yml @@ -0,0 +1,55 @@ +# When Dashy's version in package.json is updated +# this workflow will create a new tag +# And then publish it to the repository +name: ๐Ÿ—๏ธ Tag on Version Change + +on: + workflow_dispatch: + push: + branches: + - master + paths: + - 'package.json' + +jobs: + tag-if-version-updated: + runs-on: ubuntu-latest + + steps: + - name: Check Out Repository ๐Ÿ›Ž๏ธ + uses: actions/checkout@v2 + + - name: Set Up Python ๐Ÿ + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Extract Version from package.json ๐Ÿ”ข + id: package_version + run: | + import json + with open('package.json', 'r') as f: + version = json.load(f)['version'] + print(f"::set-output name=VERSION::{version}") + shell: python + + - name: Get Latest Tag ๐Ÿท๏ธ + id: latest_tag + run: | + git fetch --tags + latest_tag=$(git describe --tags `git rev-list --tags --max-count=1` 2>/dev/null) + echo "::set-output name=TAG::${latest_tag:-0}" + + - name: Create and Push Tag โคด๏ธ + if: steps.package_version.outputs.VERSION != steps.latest_tag.outputs.TAG && steps.latest_tag.outputs.TAG != '0' + run: | + git config --local user.email "liss-bot@d0h.co" + git config --local user.name "Liss-Bot" + git tag -a ${{ steps.package_version.outputs.VERSION }} -m "Release v${{ steps.package_version.outputs.VERSION }}" + git push origin ${{ steps.package_version.outputs.VERSION }} + env: + GIT_AUTHOR_NAME: Liss-Bot + GIT_AUTHOR_EMAIL: liss-bot@d0h.co + GIT_COMMITTER_NAME: Liss-Bot + GIT_COMMITTER_EMAIL: liss-bot@d0h.co + GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} From 4474cccf309ef211dd98d8a256a0768c6a341da0 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 25 May 2024 14:59:34 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=94=A8=20Add=20a=20workflow=20to=20dr?= =?UTF-8?q?aft=20a=20release=20when=20new=20tag=20published?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/draft-release.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/draft-release.yml diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml new file mode 100644 index 0000000000..0355bd42f0 --- /dev/null +++ b/.github/workflows/draft-release.yml @@ -0,0 +1,30 @@ +name: ๐Ÿ—๏ธ Draft New Release + +on: + push: + tags: + - '*.*.*' + +jobs: + create-draft-release: + runs-on: ubuntu-latest + steps: + - name: Checkout code ๐Ÿ›Ž๏ธ + uses: actions/checkout@v2 + with: + fetch-depth: 0 # We need all history for generating release notes + + - name: Create Draft Release ๐Ÿ“ + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: true + prerelease: false + generate_release_notes: true + + - name: Output new release URL โ†—๏ธ + run: 'echo "Draft release URL: ${{ steps.create_release.outputs.html_url }}"'