diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index 877fc24..4e0bc8a 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -32,12 +32,3 @@ jobs: run: | yarn build yarn package - - - name: Compare the expected and actual dist/ directories - run: | - if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then - echo "Detected uncommitted changes after build. See status below:" - git diff - exit 1 - fi - id: diff diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1c473ed --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +name: Release + +concurrency: + group: release + cancel-in-progress: false + +on: + workflow_dispatch: + inputs: + type: + description: release type + required: true + type: choice + default: patch + options: + - patch + - minor + - major + +jobs: + release: + name: Release pushed tag + runs-on: ubuntu-22.04 + steps: + - name: bump version + shell: bash + run: npm version ${{inputs.type}} + - name: Get Package version + id: version + uses: zoexx/github-action-json-file-properties@release + with: + file_path: 'package.json' + prop_path: 'version' + - name: commit to main + shell: bash + env: + CI_COMMIT_MESSAGE: 'feat: released a new version' + CI_COMMIT_AUTHOR: Continuous Integration + run: | + git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" + git config --global user.email "username@users.noreply.github.com" + git add . + git commit -m "${{env.CI_COMMIT_MESSAGE}}" + git tag -a ${{steps.version}} head -m "chore: released vserion ${{steps.version}}" + git push origin main + git push --tags + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} + tag: main + run: | + gh release create "${{steps.version}}" \ + --title="Released Artifact ${{steps.version}}" \ + --generate-notes \ + --verify-tag + --draft diff --git a/.github/workflows/update-dist.yml b/.github/workflows/update-dist.yml index fb408f1..86a7953 100644 --- a/.github/workflows/update-dist.yml +++ b/.github/workflows/update-dist.yml @@ -5,6 +5,10 @@ # We need to make sure the checked-in `index.js` actually matches what we expect it to be. name: Update dist/ +concurrency: + group: update-main + cancel-in-progress: false + on: push: branches: