forked from hyperledger/besu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hyperledger#30 from jflo/gha_artifacts
build artifacts on release draft
- Loading branch information
Showing
10 changed files
with
301 additions
and
133 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,74 @@ | ||
name: "Container Images" | ||
name: docker | ||
on: | ||
workflow_dispatch: | ||
|
||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
buildX64Docker: | ||
runs-on: [X64, Linux] | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
hadolint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: export runner UID | ||
run: echo "runner_uid=$UID" >> $GITHUB_ENV | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
cache: gradle | ||
- name: hadoLint_openjdk_11 | ||
run: docker run --rm -i hadolint/hadolint < docker/openjdk-11/Dockerfile | ||
- name: hadoLint_openjdk_11_debug | ||
run: docker run --rm -i hadolint/hadolint < docker/openjdk-11-debug/Dockerfile | ||
- name: setup gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: hadoLint_openj9-jdk_17 | ||
run: docker run --rm -i hadolint/hadolint < docker/openj9-jdk-17/Dockerfile | ||
- name: hadoLint_openjdk_17 | ||
run: docker run --rm -i hadolint/hadolint < docker/openjdk-17/Dockerfile | ||
- name: hadoLint_openjdk_17_debug | ||
run: docker run --rm -i hadolint/hadolint < docker/openjdk-17-debug/Dockerfile | ||
- name: hadoLint_openjdk_latest | ||
run: docker run --rm -i hadolint/hadolint < docker/openjdk-latest/Dockerfile | ||
- name: hadoLint_graalvm | ||
run: docker run --rm -i hadolint/hadolint < docker/graalvm/Dockerfile | ||
- name: distDocker | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: distDocker | ||
- name: test image | ||
run: | | ||
mkdir -p docker/reports | ||
curl -L https://github.com/aelsabbahy/goss/releases/download/v0.3.9/goss-linux-amd64 -o ./docker/tests/goss-linux-amd64 | ||
- name: distDocker | ||
uses: gradle/gradle-build-action@v2 | ||
env: | ||
architecture: amd64 | ||
with: | ||
arguments: testDocker | ||
- name: Login to DockerHub | ||
if: ${{ github.actor != 'dependabot[bot]' && (contains('refs/heads/release-', github.ref) || github.ref == 'refs/heads/main') }} | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USER_RW }} | ||
password: ${{ secrets.DOCKER_PASSWORD_RW }} | ||
- name: publish | ||
if: ${{ github.actor != 'dependabot[bot]' && (contains('refs/heads/release-', github.ref) || github.ref == 'refs/heads/main') }} | ||
run: ./gradlew --no-daemon "-Pbranch=${{ github.head_ref || github.ref_name }}" dockerUpload | ||
- name: Correct Ownership in GITHUB_WORKSPACE directory | ||
uses: peter-murray/reset-workspace-ownership-action@v1 | ||
with: | ||
user_id: ${{ env.runner_uid }} | ||
buildArm64Docker: | ||
runs-on: [self-hosted, ARM64, Linux] | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
buildDocker: | ||
runs-on: ubuntu-22.04 | ||
needs: hadolint | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- linux/amd64 | ||
- linux/arm/v6 | ||
- linux/arm/v7 | ||
- linux/arm64 | ||
steps: | ||
- name: export runner UID | ||
run: echo "runner_uid=$UID" >> $GITHUB_ENV | ||
- name: Prepare | ||
run: | | ||
platform=${{ matrix.platform }} | ||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: zulu | ||
architecture: arm64 | ||
distribution: adopt | ||
java-version: 17 | ||
cache: gradle | ||
- name: Docker login | ||
run: | | ||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
- name: buildDocker | ||
- name: setup gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: distDocker | ||
uses: gradle/gradle-build-action@v2 | ||
env: | ||
architecture: arm64 | ||
with: | ||
arguments: distDocker | ||
- name: download image test binary | ||
- name: test image | ||
run: | | ||
mkdir -p docker/reports | ||
curl -L https://github.com/aelsabbahy/goss/releases/download/v0.3.9/goss-linux-arm -o ./docker/tests/goss-linux-arm64 | ||
- name: testDocker | ||
curl -L https://github.com/aelsabbahy/goss/releases/download/v0.3.9/goss-$PLATFORM-PAIR -o ./docker/tests/goss-$PLATFORM-PAIR | ||
- name: test docker | ||
uses: gradle/gradle-build-action@v2 | ||
env: | ||
architecture: arm64 | ||
with: | ||
arguments: testDocker | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
if: ${{ github.actor != 'dependabot[bot]' && (contains('refs/heads/release-', github.ref) || github.ref == 'refs/heads/main') }} | ||
with: | ||
username: ${{ secrets.DOCKER_USER_RW }} | ||
password: ${{ secrets.DOCKER_PASSWORD_RW }} | ||
- name: publish | ||
if: ${{ github.actor != 'dependabot[bot]' && (contains('refs/heads/release-', github.ref) || github.ref == 'refs/heads/main') }} | ||
uses: gradle/gradle-build-action@v2 | ||
env: | ||
architecture: arm64 | ||
with: | ||
arguments: "-Pbranch=${{ github.head_ref || github.ref_name }} dockerUpload" | ||
- name: Correct Ownership in GITHUB_WORKSPACE directory | ||
uses: peter-murray/reset-workspace-ownership-action@v1 | ||
with: | ||
user_id: ${{ env.runner_uid }} | ||
run: ./gradlew --no-daemon -PdockerOrgName=${{ secrets.DOCKER_ORG }} dockerUpload |
Oops, something went wrong.