Release Project #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Project | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| changelog: | |
| type: string | |
| description: 'Changelog to replace the auto-generated one' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install Dependencies | |
| run: | | |
| bun install --global husky | |
| bun install --frozen-lockfile | |
| - name: Build Project | |
| run: bun run build | |
| - name: Publish to NPM | |
| run: bun publish --registry https://registry.npmjs.org | |
| env: | |
| NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish to GitHub Packages | |
| run: bun publish --registry https://npm.pkg.github.com | |
| env: | |
| NPM_CONFIG_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract Version from package.json | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "Extracted Version: $VERSION" | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Retrieve Latest Tag | |
| id: latest_tag | |
| run: echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | |
| - name: Generate Changelog | |
| if: ${{ github.event.inputs.changelog == '' }} | |
| id: changelog | |
| uses: mikepenz/release-changelog-builder-action@v5 | |
| with: | |
| configuration: ".github/release.json" | |
| mode: "HYBRID" | |
| fromTag: "${{ env.LATEST_TAG }}" | |
| toTag: "master" | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ env.VERSION }} | |
| name: CollegeDB v${{ env.VERSION }} | |
| body: ${{ steps.changelog.outputs.changelog || github.event.inputs.changelog }} | |
| draft: false | |
| prerelease: false |