Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
BREAKING CHANGE: initial commit
  • Loading branch information
MuchaSsak authored and MuchaSsak committed Dec 5, 2023
0 parents commit 85d17e5
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
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: Releases
on:
push:
branches:
- main
paths-ignore:
- "data/**"

jobs:
changelog:
timeout-minutes: 60
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create new temporary branch
run: git branch "release-from-${{ github.sha }}" "${{ github.sha }}"

- name: Switch to new branch
run: git checkout release-from-${{ github.sha }}

- name: Conventional changelog action
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version-file: "./package.json"
git-branch: "release-from-${{ github.sha }}"
skip-git-pull: true

- name: Create a PR with release info
if: steps.changelog.outputs.skipped == 'false'
id: create-pr
run: gh pr create --base main --head release-from-${{ github.sha }} --title 'Merge new release into main' --body 'Created by Github action'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Merge the PR
if: steps.changelog.outputs.skipped == 'false'
id: merge-pr
run: gh pr merge --admin --merge --subject 'Merge release info' --delete-branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create release with last commit
if: steps.changelog.outputs.skipped == 'false'
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.changelog.outputs.tag }}
name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Automatic releases 📃

Generate semantic changelogs, bump package versions and create GitHub releases with apprioprate tags. All automated by GitHub Actions.

## More information

The action runs on every `push` on the `main` branch. It may also push the new/updated `CHANGELOG.md` file and update the `package.json` file depending on your commit message. This system is based on [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).

## Repository settings

⚠️ In order for the actions to work, you need to enable **Read and write permissions** and **Allow GitHub actions to create and approve pull requests** Workflow permisions in the `Actions > General` tab. These settings are turned off by default, but it's important that you enable them. [Learn more about managing permisions here](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token).

## License

[MIT](https://choosealicense.com/licenses/mit/)
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "conventional-changelog",
"private": true,
"version": "0.0.0",
"license": "MIT"
}

0 comments on commit 85d17e5

Please sign in to comment.