Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: created release workflow #59

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading