Use Node 22 for chaincode Docker image (#436) #9
Workflow file for this run
This file contains 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
# Copyright the Hyperledger Fabric contributors. All rights reserved. | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Release | |
on: | |
push: | |
tags: | |
- "v2.*" | |
workflow_dispatch: | |
jobs: | |
test: | |
uses: ./.github/workflows/test.yaml | |
publishnpm: | |
runs-on: ubuntu-24.04 | |
needs: test | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18.x" | |
registry-url: "https://registry.npmjs.org" | |
- uses: actions/download-artifact@v4 | |
with: | |
name: node-tgzs | |
path: build/ | |
- run: | | |
set -xev | |
ls -lart build/ | |
cd build | |
find . -type f -name 'fabric-*.tgz' -exec npm publish {} \; | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publishdocker: | |
runs-on: ubuntu-latest | |
needs: test | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
fail-fast: false | |
matrix: | |
DOCKER_REGISTRY: | |
- "docker.io" | |
- "ghcr.io" | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
buildkitd-flags: --debug | |
buildkitd-config-inline: | | |
[worker.oci] | |
max-parallelism = 1 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to the ${{ matrix.DOCKER_REGISTRY }} Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ matrix.DOCKER_REGISTRY }} | |
username: ${{ matrix.DOCKER_REGISTRY == 'docker.io' && secrets.DOCKERHUB_USERNAME || github.actor }} | |
password: ${{ matrix.DOCKER_REGISTRY == 'docker.io' && secrets.DOCKERHUB_TOKEN || secrets.GITHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ matrix.DOCKER_REGISTRY }}/${{ github.repository_owner }}/fabric-nodeenv | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}}.{{minor}}.{{patch}} | |
- name: Build and push image | |
id: push | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
file: docker/fabric-nodeenv/Dockerfile | |
context: docker/fabric-nodeenv | |
tags: ${{ steps.meta.outputs.tags }} | |
push: ${{ github.event_name != 'pull_request' }} | |
labels: ${{ steps.meta.outputs.labels }} |