docs: add Everruns logo (#107) #67
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| actions: write | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| # Only run if manually triggered OR commit message starts with "chore(release): prepare v" | |
| if: "${{ github.event_name == 'workflow_dispatch' || startsWith(github.event.head_commit.message, 'chore(release): prepare v') }}" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Extract version | |
| id: version | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| COMMIT_MSG: ${{ github.event.head_commit.message }} | |
| run: | | |
| if [ "$EVENT_NAME" = "workflow_dispatch" ]; then | |
| # Manual trigger: read version from rust/Cargo.toml | |
| VERSION=$(grep '^version' rust/Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/') | |
| else | |
| # Push trigger: extract from commit message | |
| VERSION=$(echo "$COMMIT_MSG" | sed -n 's/.*prepare v\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p') | |
| fi | |
| if [ -z "$VERSION" ]; then | |
| echo "Error: Could not determine version" | |
| exit 1 | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "tag=v$VERSION" >> $GITHUB_OUTPUT | |
| echo "Detected version: $VERSION" | |
| - name: Verify version matches all manifests | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| RUST_VERSION=$(grep '^version' rust/Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/') | |
| if [ "$VERSION" != "$RUST_VERSION" ]; then | |
| echo "Error: Version ($VERSION) does not match rust/Cargo.toml ($RUST_VERSION)" | |
| exit 1 | |
| fi | |
| PYTHON_VERSION=$(grep '^version' python/pyproject.toml | head -1 | sed 's/.*"\(.*\)".*/\1/') | |
| if [ "$VERSION" != "$PYTHON_VERSION" ]; then | |
| echo "Error: Version ($VERSION) does not match python/pyproject.toml ($PYTHON_VERSION)" | |
| exit 1 | |
| fi | |
| TS_VERSION=$(node -p "require('./typescript/package.json').version") | |
| if [ "$VERSION" != "$TS_VERSION" ]; then | |
| echo "Error: Version ($VERSION) does not match typescript/package.json ($TS_VERSION)" | |
| exit 1 | |
| fi | |
| echo "All manifests verified at version $VERSION" | |
| - name: Extract release notes from CHANGELOG | |
| id: changelog | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| # Get content between this version header and the next version header (or end) | |
| NOTES=$(awk "/^## \[$VERSION\]/{found=1; next} /^## \[/{if(found) exit} found{print}" CHANGELOG.md) | |
| # Write to file to preserve newlines | |
| echo "$NOTES" > release_notes.md | |
| echo "Release notes extracted for v$VERSION" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.tag }} | |
| name: Release ${{ steps.version.outputs.tag }} | |
| body_path: release_notes.md | |
| draft: false | |
| prerelease: false | |
| - name: Trigger publish workflow | |
| run: gh workflow run publish.yml | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |