Skip to content

Release

Release #7

Workflow file for this run

# Copyright the Hyperledger Fabric contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
name: Release
on:
create:
tags:
- '*'
workflow_dispatch:
jobs:
test:
uses: ./.github/workflows/test.yaml

Check failure on line 15 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

error parsing called workflow ".github/workflows/release.yml" -> "./.github/workflows/test.yaml" : failed to fetch workflow: workflow was not found.
# Publishing steps to both the Github Packages and the Sonatype
publishjars:
strategy:
fail-fast: false
matrix:
publish_target:
- publishAllPublicationsToGithubPackagesRepository
- publishAllPublicationsToReleaseRepository
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Push to registry ${{ matrix.publish_target }}
run: |
set -xev
./gradlew -Psigning.key="${SIGNING_KEY}" -Psigning.password="${SIGNING_PASSWORD}" -PossrhUsername="${OSSRH_USER}" -PossrhPassword="${OSSRH_PASSWORD}" ${TARGET}
env:
SIGNING_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
SIGNING_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
OSSRH_USER: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
TARGET: ${{ matrix.publish_target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Publish to docker registries docker.io and ghcr.io
publishdocker:
strategy:
fail-fast: false
matrix:
DOCKER_REGISTRY:
- 'docker.io'
- 'ghcr.io'
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build the dependencies needed for the image
uses: gradle/gradle-build-action@v2
with:
arguments: |
:fabric-chaincode-docker:copyAllDeps -x dependencyCheckAnalyze
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
buildkitd-flags: --debug
config-inline: |
[worker.oci]
max-parallelism = 1
- name: Login to the ${{ matrix.DOCKER_REGISTRY }} Container Registry
uses: docker/login-action@v2
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@v4
with:
images: ${{ matrix.DOCKER_REGISTRY }}/${{ github.repository_owner }}/fabric-javaenv
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
- name: Build and push ${{ matrix.COMPONENT }} Image
id: push
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm64
file: fabric-chaincode-docker/Dockerfile
context: fabric-chaincode-docker
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}