Skip to content

Commit

Permalink
feat: created release workflow (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
saurav0705 committed Mar 16, 2024
1 parent 06e6b67 commit 4af31b5
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 9 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
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
4 changes: 4 additions & 0 deletions .github/workflows/update-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4af31b5

Please sign in to comment.