diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index fcca4ea..0000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,31 +0,0 @@ -name-template: 'v$RESOLVED_VERSION 🌈' -tag-template: 'v$RESOLVED_VERSION' -categories: - - title: '🚀 Features' - labels: - - 'feature' - - 'enhancement' - - title: '🐛 Bug Fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - - title: '🧰 Maintenance' - label: 'chore' -change-template: '- $TITLE @$AUTHOR (#$NUMBER)' -change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. -version-resolver: - major: - labels: - - 'major' - minor: - labels: - - 'minor' - patch: - labels: - - 'patch' - default: patch -template: | - ## Changes - - $CHANGES diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 0000000..8a29ef9 --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,68 @@ +name: Prepare new release + +on: + workflow_dispatch: + inputs: + versionBump: + description: "Bump version" + required: true + default: "false" + type: choice + options: + - "false" + - "minor" + - "patch" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-root + cancel-in-progress: true + +jobs: + prepare_release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "16" + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + - name: Set up Git + run: | + git config user.name "Aamir Azad" + git config user.email "aamirmazad@gmail.com" + + - name: Get tag + id: get_tag + run: | + git branch --show-current + git pull + echo "::set-output name=version::v$(npm pkg get version | tr -d '\"')" + + - name: Tag the commit + run: | + next_version=${{ steps.get_tag.outputs.version }} + git tag -a "$next_version" -m "Version $next_version" + git push --follow-tags + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + files: ./build/* + tag_name: ${{ steps.get_tag.outputs.version }} + name: v${{ steps.get_tag.outputs.version }} + # Automatically generate release notes based on commits + generate_release_notes: true + draft: true + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index 9f63d74..0000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Release Drafter - -on: - 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] - # pull_request_target event is required for autolabeler to support PRs from forks - # pull_request_target: - # 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: write - runs-on: ubuntu-latest - steps: - # (Optional) GitHub Enterprise requires GHE_HOST variable set - #- name: Set GHE_HOST - # run: | - # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV - - # Drafts your next Release notes as Pull Requests are merged into "master" - - 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 }}