fix(core): don't test clone.sh using core test cases #33
Workflow file for this run
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: Create Release | |
| on: | |
| push: | |
| branches: [$default-branch] | |
| tags: ["v*"] | |
| pull_request: | |
| branches: [$default-branch] | |
| types: [closed] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| # triggered when a new tag is pushed or a PR is merged into 'main' | |
| if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # NOTE: if you want to reuse commit messages as release note's body | |
| # NOTE: fetch all code history | |
| with: | |
| fetch-depth: 0 | |
| # this step outputs the version | |
| # refer to it as ${{ steps.get_version.outputs.version }}` | |
| - name: Check if current version is the same as the latest version | |
| id: check_version | |
| run: | | |
| # Get the current tag if we're on a tag push, otherwise get the latest tag | |
| if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" =~ ^refs/tags/ ]]; then | |
| VERSION="${{ github.ref_name }}" | |
| else | |
| VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | |
| fi | |
| echo "version=${VERSION}" >> ${GITHUB_OUTPUT} | |
| LATEST_VERSION=$(gh release list --limit 1 --json tagName --jq '.[0].tagName // ""') | |
| if [[ "${VERSION}" == "${LATEST_VERSION}" ]]; then | |
| echo "skip_release=true" >> ${GITHUB_OUTPUT} | |
| else | |
| echo "skip_release=false" >> ${GITHUB_OUTPUT} | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release | |
| if: steps.check_version.outputs.skip_release == 'false' | |
| run: | | |
| LATEST_TAG=$(gh release list --limit 1 --json tagName --jq '.[0].tagName // ""') | |
| if [[ -n "$LATEST_TAG" ]]; then | |
| COMMIT_RANGE="${LATEST_TAG}..HEAD" | |
| else | |
| COMMIT_RANGE="HEAD" | |
| fi | |
| echo "## What's Changed" > release_notes.md | |
| echo "" >> release_notes.md | |
| # Indent 2 spaces with list, 4 spaces with continuation line, none for commit title | |
| git log $COMMIT_RANGE --pretty=format:"* %s%n%n%b" --reverse | sed '/^$/N;/^\n$/d' | awk '/^\*/ { print; getline; print; next }/^-/ { print " " $0; next }{ print " " $0 }' >> release_notes.md | |
| # Also add auto-generated notes for PR info | |
| echo "" >> release_notes.md | |
| echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${LATEST_TAG}...${{ steps.check_version.outputs.version }}" >> release_notes.md | |
| gh release create \ | |
| ${{ steps.check_version.outputs.version }} \ | |
| --title ${{ steps.check_version.outputs.version }} \ | |
| --fail-on-no-commits \ | |
| --verify-tag \ | |
| --target main \ | |
| --notes-file release_notes.md \ | |
| --latest \ | |
| source.sh script.sh template.sh template_lite.sh template_legacy clone.sh | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |