Merge pull request #63 from RSquad/release/node/v0.4.0 #5
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: Publish node | |
| on: | |
| push: | |
| tags: | |
| - "node/v*" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.sha }} | |
| cancel-in-progress: true | |
| env: | |
| WORKING_DIR: src | |
| jobs: | |
| container: | |
| runs-on: | |
| group: ton-large | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Get commit timestamp | |
| id: commit | |
| run: echo "date=$(git log -1 --format=%cI)" >> "$GITHUB_OUTPUT" | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/rsquad/ton-rust-node/node | |
| tags: | | |
| type=match,pattern=node/(v.*),group=1 | |
| type=raw,value=latest,enable=${{ !contains(github.ref_name, 'rc') && !contains(github.ref_name, 'alpha') && !contains(github.ref_name, 'beta') }} | |
| type=sha | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./src | |
| file: ./src/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| GIT_BRANCH=${{ github.ref_name }} | |
| GIT_COMMIT=${{ github.sha }} | |
| GIT_COMMIT_DATE=${{ steps.commit.outputs.date }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| release: | |
| needs: [container] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#node/}" | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| if echo "$VERSION" | grep -qE '(rc|alpha|beta)'; then | |
| echo "prerelease=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "prerelease=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: "node/${{ steps.version.outputs.version }}" | |
| body: | | |
| node ${{ steps.version.outputs.version }} | |
| Image: `ghcr.io/rsquad/ton-rust-node/node:${{ steps.version.outputs.version }}` | |
| prerelease: ${{ steps.version.outputs.prerelease }} | |
| make_latest: ${{ steps.version.outputs.prerelease != 'true' }} | |
| draft: ${{ steps.version.outputs.prerelease }} | |
| - name: Publish pre-release | |
| if: steps.version.outputs.prerelease == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release edit "$GITHUB_REF_NAME" --draft=false |