diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62a2f90..58e5c48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,57 +38,7 @@ jobs: - name: Release id: semantic_release - run: | - npx semantic-release - NEXT_RELEASE=$(jq -r '.nextRelease.version' semantic-release.json) - echo "nextRelease=$NEXT_RELEASE" >> $GITHUB_OUTPUT + run: npx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Create Release Branch - if: success() && steps.semantic_release.outputs.nextRelease != '' - run: | - VERSION=${{ steps.semantic_release.outputs.nextRelease.version }} - git checkout -b ${{ inputs.release-branch-prefix }}${VERSION} - - - name: Push Release Branch - if: success() && steps.semantic_release.outputs.nextRelease != '' - env: - PAT: ${{ secrets.PAT_FORCE_PUSH }} - run: | - VERSION=${{ steps.semantic_release.outputs.nextRelease.version }} - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git remote set-url origin https://x-access-token:${PAT}@github.com/${{ github.repository }}.git - git push origin ${{ inputs.release-branch-prefix }}${VERSION} --force - - - name: Extract Version from package.json - id: extract_version - run: | - VERSION=$(jq -r .version package.json) - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Extract Changelog - id: changelog - run: | - CHANGELOG=$(awk '/^## \[/ {print; exit}' CHANGELOG.md) - echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT - - - name: Create Pull Request to Main - if: success() && steps.semantic_release.outputs.nextRelease != '' - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - title: 'chore(release): ${{ steps.extract_version.outputs.version }}' - body: | - This is an automated pull request for release version `${{ steps.extract_version.outputs.version }}`. - - **Changelog:** - ``` - ${{ steps.changelog.outputs.changelog }} - ``` - head: ${{ inputs.release-branch-prefix }}${{ steps.extract_version.outputs.version }} - base: main - commit-message: 'chore(release): ${{ steps.extract_version.outputs.version }} [skip ci]' - labels: ${{ inputs.release-label }} diff --git a/Writerside/topics/Release.md b/Writerside/topics/Release.md index 68e32a7..7291989 100644 --- a/Writerside/topics/Release.md +++ b/Writerside/topics/Release.md @@ -32,15 +32,9 @@ sequenceDiagram SemanticRelease-->>Runner: Determine Next Release Version alt Next Release Exists - Runner->>Runner: Create Release Branch - Runner->>Runner: Push Release Branch to GitHub - - Runner->>Runner: Extract Version from package.json - Runner->>Runner: Extract Changelog from CHANGELOG.md - - Runner->>GitHubAPI: Create Pull Request to `main` with Release Branch + Runner->>SemanticRelease: subsequent steps are followed else No Release Needed - Note right of Runner: "Create Release Branch" and subsequent steps are skipped + Note right of Runner: subsequent steps are skipped end SemanticRelease->>NPM: Publish Package to NPM Registry diff --git a/package.json b/package.json index b720ae1..818a707 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kurocado-studio/style-guide", - "version": "1.3.0", + "version": "0.0.0-semantically-released", "description": "Kurocado Studio's engineering style guide", "homepage": "https://github.com/Kurocado-Studio/styleguide", "bugs": {