Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build to avoid deprecated GitHub actions #411

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
runs-on: ubuntu-20.04
needs: test
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: node-tgzs
path: build/
Expand All @@ -46,29 +46,29 @@ jobs:

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
config-inline: |
[worker.oci]
max-parallelism = 1

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Login to the ${{ env.DOCKER_REGISTRY }} Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ env.DOCKER_REGISTRY == 'docker.io' && secrets.DOCKERHUB_USERNAME || github.actor }}
password: ${{ env.DOCKER_REGISTRY == 'docker.io' && secrets.DOCKERHUB_TOKEN || secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ github.repository_owner }}/fabric-nodeenv
tags: |
Expand All @@ -78,7 +78,7 @@ jobs:

- name: Build and push ${{ matrix.COMPONENT }} Image
id: push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
file: docker/fabric-nodeenv/Dockerfile
Expand Down
45 changes: 22 additions & 23 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
MINOR_PACKAGE_VERSION: ${{ steps.builddata.outputs.MINOR_PACKAGE_VERSION }}
BUILD_DATE: ${{ steps.builddata.outputs.BUILD_DATE }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: BuildData
Expand Down Expand Up @@ -43,8 +43,8 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install/Rebuild/UnitTest
Expand All @@ -55,9 +55,9 @@ jobs:
- name: Pre-process Artifacts
run: |
npx cobertura-merge -o merged_coverage.xml shim=./libraries/fabric-shim/coverage/cobertura-coverage.xml contractapi=./apis/fabric-contract-api/coverage/cobertura-coverage.xml -p
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload test results
if: success() || failure()
if: ${{ !cancelled() }}
with:
name: TestResults
path: ./**/test-results.xml
Expand All @@ -68,13 +68,13 @@ jobs:
node common/scripts/install-run-rush.js publish --include-all --pack --release-folder tgz --publish
docker image save hyperledger/fabric-nodeenv | gzip > fabric-nodeenv.tar.gz

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Binaries
with:
name: node-tgzs
path: tgz/

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Docker
with:
name: nodeenv-docker-image
Expand All @@ -84,16 +84,16 @@ jobs:
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: nodeenv-docker-image
path: build/
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: node-tgzs
path: build/
Expand Down Expand Up @@ -121,28 +121,27 @@ jobs:
node common/scripts/install-run-rush.js test:fv --verbose
node common/scripts/install-run-rush.js test:e2e --verbose


- uses: actions/upload-artifact@v3
if: success() || failure()
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
name: TestLogs
with:
name: TestLogs
path: ./**/*.build.log
path: "**/*.build.log"


# Job to handle the auditing of the code
# NPM audit is run on a 'fake' installation of the libraries
# Pulling in all the dependencies it will be able to run NPM AUDIT, and if that returns a
# error code the job will fail.
# Job to handle the auditing of the code
# NPM audit is run on a 'fake' installation of the libraries
# Pulling in all the dependencies it will be able to run NPM AUDIT, and if that returns a
# error code the job will fail.
src_audit:
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: node-tgzs
path: build/
Expand Down
Loading