chore: add CODE_OF_CONDUCT.md #14
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: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| env: | |
| REGISTRY: docker.io | |
| IMAGE_NAME: ${{ secrets.DOCKER_REPOSITORY }} | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| # ─── Run full CI first ──────────────────────────────────────── | |
| ci: | |
| name: CI | |
| uses: ./.github/workflows/ci.yml | |
| # ─── Build and push Docker image ────────────────────────────── | |
| docker: | |
| name: Docker | |
| runs-on: ubuntu-latest | |
| needs: ci | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Extract version from tag | |
| id: meta | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} | |
| ${{ env.IMAGE_NAME }}:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| labels: | | |
| org.opencontainers.image.title=RocketMQ | |
| org.opencontainers.image.description=AMQP 0-9-1 message broker written in Rust | |
| org.opencontainers.image.version=${{ steps.meta.outputs.version }} | |
| org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
| # ─── Create GitHub Release ──────────────────────────────────── | |
| release: | |
| name: GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: [ci, docker] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| PREV_TAG=$(git tag --sort=-creatordate | sed -n '2p') | |
| if [ -z "$PREV_TAG" ]; then | |
| CHANGES=$(git log --oneline --no-merges) | |
| else | |
| CHANGES=$(git log --oneline --no-merges "$PREV_TAG"..HEAD) | |
| fi | |
| { | |
| echo "changelog<<EOF" | |
| echo "$CHANGES" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: rocketmq-linux-amd64 | |
| path: dist/ | |
| - name: Package source code | |
| run: | | |
| git archive --format=tar.gz -o dist/rocketmq-${{ github.ref_name }}.tar.gz HEAD | |
| git archive --format=zip -o dist/rocketmq-${{ github.ref_name }}.zip HEAD | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body: | | |
| ## Changes | |
| ${{ steps.changelog.outputs.changelog }} | |
| ## Docker | |
| ``` | |
| docker pull ${{ env.IMAGE_NAME }}:${{ github.ref_name }} | |
| ``` | |
| files: | | |
| dist/rocketmq | |
| dist/rocketmq-${{ github.ref_name }}.tar.gz | |
| dist/rocketmq-${{ github.ref_name }}.zip | |
| generate_release_notes: false |