diff --git a/.github/workflows/bld_all.yml b/.github/workflows/bld_all.yml deleted file mode 100644 index 5a0413bc8e..0000000000 --- a/.github/workflows/bld_all.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: bld_all - -#NOTE: this deploys assets as well as builds - -permissions: - checks: write - contents: read - issues: read - pull-requests: write - -on: - workflow_call: - inputs: - version_tag: - description: 'Version tag to use: (bump must also be set to none to keep a specific version' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - - workflow_dispatch: - inputs: - version_tag: - description: 'Version tag to use: (bump must also be set to none to keep a specific version' - required: false - default: 'latest' - type: string - bump: - description: | - How to optionally bump the semver version ( Major.Minor.Patch ) : git log will be searched for - '#major #minor #patch' or feat/ or fix/ branch names to optionally override the bump. Set to none to keep a specific version - required: false - options: - - patch - - minor - - major - - none - type: choice - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - - - -jobs: - bld_prod: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - artifact_name: prod - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - bld_sandbox: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - artifact_name: sandbox - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - bld_qa: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - artifact_name: qa - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - bld_int: - uses: ./.github/workflows/bld_maven.yml - secrets: inherit # pass all secrets - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - artifact_name: int - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} diff --git a/.github/workflows/bld_all_docker.yml b/.github/workflows/bld_all_docker.yml deleted file mode 100644 index 3dd354d64c..0000000000 --- a/.github/workflows/bld_all_docker.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: bld_all_docker - -permissions: - checks: write - contents: read - issues: read - pull-requests: write - -on: - workflow_call: - inputs: - version_tag: - description: 'Version tag to use: (bump must also be set to none to keep a specific version' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - - workflow_dispatch: - inputs: - version_tag: - description: 'Version tag to use: (bump must also be set to none to keep a specific version' - required: false - default: 'latest' - type: string - bump: - description: 'whether to bump the version number by a major minor patch' - required: false - default: 'patch' - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - -jobs: - - bld_angular_prod: - uses: ./.github/workflows/bld_docker.yml - secrets: inherit # pass all secrets - with: - docker_name: orcid/registry/orcid-web-frontend-prod - context: . - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - build_args: "build_env=prod" - file: Dockerfile.build - bld_angular_sandbox: - uses: ./.github/workflows/bld_docker.yml - secrets: inherit # pass all secrets - with: - docker_name: orcid/registry/orcid-web-frontend-sandbox - context: . - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - build_args: "build_env=sandbox" - file: Dockerfile.build - bld_angular_qa: - uses: ./.github/workflows/bld_docker.yml - secrets: inherit # pass all secrets - with: - docker_name: orcid/registry/orcid-web-frontend-qa - context: . - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - build_args: "build_env=qa" - file: Dockerfile.build - bld_angular_int: - uses: ./.github/workflows/bld_docker.yml - secrets: inherit # pass all secrets - with: - docker_name: orcid/registry/orcid-web-frontend-int - context: . - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - build_args: "build_env=int" - file: Dockerfile.build - - diff --git a/.github/workflows/bld_all_yarn.yml b/.github/workflows/bld_all_yarn.yml deleted file mode 100644 index 26a8955446..0000000000 --- a/.github/workflows/bld_all_yarn.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: bld_all_yarn - -on: - workflow_call: - - workflow_dispatch: - -jobs: - bld_prod: - uses: ./.github/workflows/bld_yarn.yml - with: - artifact_name: prod -# bld_sandbox: -# uses: ./.github/workflows/bld_yarn.yml -# with: -# artifact_name: sandbox -# -# bld_qa: -# uses: ./.github/workflows/bld_yarn.yml -# with: -# artifact_name: qa -# -# bld_int: -# uses: ./.github/workflows/bld_yarn.yml -# with: -# artifact_name: int -# diff --git a/.github/workflows/bld_docker.yml b/.github/workflows/bld_docker.yml index 8402339f60..fb0bdb38e0 100644 --- a/.github/workflows/bld_docker.yml +++ b/.github/workflows/bld_docker.yml @@ -1,5 +1,4 @@ name: bld_docker -run-name: ${{ inputs.docker_name }} permissions: checks: write @@ -21,7 +20,7 @@ on: default: "." type: string build_args: - description: 'arguments' + description: 'build_args e.g wibble=blar' required: false default: "" type: string @@ -59,7 +58,7 @@ on: default: "." type: string build_args: - description: 'arguments' + description: 'build_args e.g wibble=blar' required: false default: "" type: string @@ -87,6 +86,29 @@ on: jobs: bld_docker: + strategy: + matrix: + include: + - artifact_name: prod + docker_name: orcid/registry/orcid-web-frontend-prod + build_args: "build_env=prod" + file: Dockerfile.build + + - artifact_name: sandbox + docker_name: orcid/registry/orcid-web-frontend-sandbox + build_args: "build_env=sandbox" + file: Dockerfile.build + + - artifact_name: qa + docker_name: orcid/registry/orcid-web-frontend-qa + build_args: "build_env=qa" + file: Dockerfile.build + + - artifact_name: int + docker_name: orcid/registry/orcid-web-frontend-int + build_args: "build_env=int" + file: Dockerfile.build + runs-on: ubuntu-latest steps: - name: git-checkout-ref-action @@ -96,7 +118,7 @@ jobs: default_branch: ${{ github.event.repository.default_branch }} ref: ${{ inputs.ref }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ steps.ref.outputs.ref }} # checkout some history so we can scan commits for bump messages @@ -110,8 +132,8 @@ jobs: version_tag: ${{ inputs.version_tag }} bump: ${{ inputs.bump }} - - uses: docker/setup-buildx-action@v2 - - uses: actions/cache@v3 + - uses: docker/setup-buildx-action@v3 + - uses: actions/cache@v4 with: path: /tmp/.buildx-cache # each cache needs a unique key for the job @@ -121,7 +143,7 @@ jobs: restore-keys: | ${{ runner.os }}-buildx- - name: Login to private registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ secrets.DOCKER_REG_PRIVATE }} username: ${{ secrets.DOCKER_USER }} @@ -130,20 +152,20 @@ jobs: - name: nasty hack to allow dynamic defaults id: dynamic_defaults run: | - FILE="${{ github.event.inputs.file }}" + FILE="${{ matrix.file }}" echo "default_file=${FILE:-${{ inputs.context }}/Dockerfile}" >> "$GITHUB_OUTPUT" - name: show the dynamic defaults run: | echo ${{ steps.dynamic_defaults.outputs.default_file }} - - uses: docker/build-push-action@v3 + - uses: docker/build-push-action@v6 with: push: true - tags: ${{ secrets.DOCKER_REG_PRIVATE }}/${{ inputs.docker_name}}:${{ steps.version.outputs.version_tag_numeric }} + tags: ${{ secrets.DOCKER_REG_PRIVATE }}/${{ matrix.docker_name}}:${{ steps.version.outputs.version_tag_numeric }} context: ${{ inputs.context }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache - build-args: ${{ inputs.build_args }} + build-args: ${{ matrix.build_args }} file: ${{ steps.dynamic_defaults.outputs.default_file }} diff --git a/.github/workflows/bld_maven.yml b/.github/workflows/bld_mvn.yml similarity index 91% rename from .github/workflows/bld_maven.yml rename to .github/workflows/bld_mvn.yml index ca055263e5..8e040c89f4 100644 --- a/.github/workflows/bld_maven.yml +++ b/.github/workflows/bld_mvn.yml @@ -1,5 +1,4 @@ -name: bld_maven -run-name: bld-{{ inputs.artifact_name }} +name: bld_mvn permissions: checks: write @@ -61,7 +60,15 @@ on: type: string jobs: - bld_maven: + bld_mvn: + strategy: + matrix: + include: + - artifact_name: prod + - artifact_name: sandbox + - artifact_name: qa + - artifact_name: int + runs-on: ubuntu-latest steps: - name: git-checkout-ref-action @@ -71,7 +78,7 @@ jobs: default_branch: ${{ github.event.repository.default_branch }} ref: ${{ inputs.ref }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ steps.ref.outputs.ref }} # checkout some history so we can scan commits for bump messages @@ -86,18 +93,12 @@ jobs: bump: ${{ inputs.bump }} - name: Set up Open JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '11' cache: 'maven' -# FIXME: think that maven somehow pulls this in, so never cached -# - name: setup node -# uses: actions/setup-node@v3 -# with: -# node-version: 'v16.x' - - name: show path run: | echo "$PATH" @@ -109,7 +110,7 @@ jobs: shell: bash env: version_tag_numeric: '${{ steps.version.outputs.version_tag_numeric }}' - project: '${{ inputs.artifact_name }}' + project: '${{ matrix.artifact_name }}' - name: bump version using prod profile run: | @@ -147,4 +148,4 @@ jobs: ARTIFACT_REPO_PATH: '${{ secrets.ARTIFACT_REPO_PATH }}' ARTIFACT_USER: '${{ secrets.ARTIFACT_USER }}' ARTIFACT_PASSWORD: '${{ secrets.ARTIFACT_PASSWORD }}' - build_env: '${{ inputs.artifact_name }}' + build_env: '${{ matrix.artifact_name }}' diff --git a/.github/workflows/build_test_release_tag.yml b/.github/workflows/bld_test_rel_tag.yml similarity index 86% rename from .github/workflows/build_test_release_tag.yml rename to .github/workflows/bld_test_rel_tag.yml index 2bb93024de..fabce5eeeb 100644 --- a/.github/workflows/build_test_release_tag.yml +++ b/.github/workflows/bld_test_rel_tag.yml @@ -1,4 +1,4 @@ -name: build_test_release_tag +name: bld_test_rel_tag on: workflow_call: @@ -42,7 +42,11 @@ on: required: false default: "default_branch" type: string - + rel_tag: + description: Whether to tag the code + type: boolean + required: false + default: true # cancel running job if another commit comes in concurrency: @@ -66,26 +70,27 @@ jobs: - format_i18n - format_prettier - unit_tests: - uses: ./.github/workflows/unit_tests.yml + test_yarn: + uses: ./.github/workflows/test_yarn.yml needs: - format_i18n - format_prettier # this is a test - bld_all_yarn: - uses: ./.github/workflows/bld_all_yarn.yml + bld_yarn: + uses: ./.github/workflows/bld_yarn.yml needs: - format_i18n - format_prettier ############################################################################## - bld_all: - uses: ./.github/workflows/bld_all.yml + # uses maven to build via yarn into a war file + bld_mvn: + uses: ./.github/workflows/bld_mvn.yml secrets: inherit # pass all secrets for uploading assets needs: - lint - - bld_all_yarn + - bld_yarn - format_i18n - format_prettier permissions: @@ -98,12 +103,12 @@ jobs: bump: ${{ inputs.bump }} ref: ${{ inputs.ref }} - bld_all_docker: - uses: ./.github/workflows/bld_all_docker.yml + bld_docker: + uses: ./.github/workflows/bld_docker.yml secrets: inherit # pass all secrets for uploading assets needs: - lint - - bld_all_yarn + - bld_yarn - format_i18n - format_prettier permissions: @@ -120,7 +125,8 @@ jobs: rel_tag: uses: ./.github/workflows/rel_tag.yml - needs: bld_all + if: ${{ inputs.rel_tag }} + needs: bld_mvn with: version_tag: ${{ inputs.version_tag }} bump: ${{ inputs.bump }} diff --git a/.github/workflows/bld_yarn.yml b/.github/workflows/bld_yarn.yml index ccd9f3382d..ebf7050343 100644 --- a/.github/workflows/bld_yarn.yml +++ b/.github/workflows/bld_yarn.yml @@ -1,5 +1,4 @@ name: bld_yarn -run-name: bld-{{ inputs.artifact_name }} permissions: checks: write @@ -25,10 +24,17 @@ on: jobs: bld_yarn: + strategy: + matrix: + include: + - artifact_name: prod + - artifact_name: sandbox + - artifact_name: qa + - artifact_name: int runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 'v20.x' cache: 'yarn' diff --git a/.github/workflows/build_test_release.yml b/.github/workflows/build_test_release.yml deleted file mode 100644 index 209d9196d2..0000000000 --- a/.github/workflows/build_test_release.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: build_test_release - -on: - workflow_call: - inputs: - version_tag: - description: 'version tag to use' - required: false - default: "latest" - type: string - bump: - description: 'whether to bump the version number by a major minor patch amount or try gitlog' - required: false - default: "patch" - type: string - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default" - type: string - - workflow_dispatch: - inputs: - version_tag: - description: 'version tag to use' - required: false - default: "latest" - type: string - bump: - description: | - How to optionally bump the semver version ( Major.Minor.Patch ) : git log will be searched for - '#major #minor #patch' or feat/ or fix/ branch names to optionally override the bump. Set to none to keep a specific version - required: false - options: - - patch - - minor - - major - - none - type: choice - ref: - description: 'git reference to use with the checkout use default_branch to have that calculated' - required: false - default: "default_branch" - type: string - - -# cancel running job if another commit comes in -concurrency: - group: main-${{ github.ref }}-1 - cancel-in-progress: true - -jobs: - format_i18n: - uses: ./.github/workflows/format_i18n.yml - secrets: inherit # pass all secrets for pushing - - format_prettier: - uses: ./.github/workflows/format_prettier.yml - secrets: inherit # pass all secrets for pushing - -############################################################################## - - lint: - uses: ./.github/workflows/lint.yml - needs: - - format_i18n - - format_prettier - - unit_tests: - uses: ./.github/workflows/unit_tests.yml - needs: - - format_i18n - - format_prettier - - # this is a test - bld_all_yarn: - uses: ./.github/workflows/bld_all_yarn.yml - needs: - - format_i18n - - format_prettier - -############################################################################## - bld_all: - uses: ./.github/workflows/bld_all.yml - secrets: inherit # pass all secrets for uploading assets - needs: - - lint - - bld_all_yarn - - format_i18n - - format_prettier - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} - - bld_all_docker: - uses: ./.github/workflows/bld_all_docker.yml - secrets: inherit # pass all secrets for uploading assets - needs: - - lint - - bld_all_yarn - - format_i18n - - format_prettier - permissions: - checks: write - contents: read - issues: read - pull-requests: write - with: - version_tag: ${{ inputs.version_tag }} - bump: ${{ inputs.bump }} - ref: ${{ inputs.ref }} diff --git a/.github/workflows/format_i18n.yml b/.github/workflows/format_i18n.yml index 2ee5db2158..06efcd942d 100644 --- a/.github/workflows/format_i18n.yml +++ b/.github/workflows/format_i18n.yml @@ -8,12 +8,12 @@ jobs: format_i18n: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # token with write permissions to protected branches # standard github token does not allow this token: ${{ secrets.RELEASE_TOKEN }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 'v20.x' cache: 'yarn' @@ -22,7 +22,7 @@ jobs: - name: add and commit any files that have changed id: add_and_commit - uses: EndBug/add-and-commit@c8bfb4ff65642c4c54445500822f6e7da558994a + uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 with: message: '🤖 GITHUB ACTIONS i18n generator' env: diff --git a/.github/workflows/format_prettier.yml b/.github/workflows/format_prettier.yml index 3b0313239a..da3020c14d 100644 --- a/.github/workflows/format_prettier.yml +++ b/.github/workflows/format_prettier.yml @@ -8,13 +8,13 @@ jobs: format_prettier: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # token with write permissions to protected branches # standard github token does not allow this token: ${{ secrets.RELEASE_TOKEN }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 'v20.x' cache: 'yarn' @@ -24,7 +24,7 @@ jobs: - name: add and commit any files that have changed id: add_and_commit - uses: EndBug/add-and-commit@c8bfb4ff65642c4c54445500822f6e7da558994a + uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 with: message: '🤖 GITHUB ACTIONS format_prettier' env: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a75a9f27b1..71e5200276 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: '3.10' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index cf7416b071..7c862e1355 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -17,12 +17,12 @@ concurrency: cancel-in-progress: true jobs: - unit_tests: - uses: ./.github/workflows/unit_tests.yml + test_yarn: + uses: ./.github/workflows/test_yarn.yml # NOTE: this is just to test - bld_all_yarn: - uses: ./.github/workflows/bld_all_yarn.yml + bld_yarn: + uses: ./.github/workflows/bld_yarn.yml # NOTE: codeql is only available on public repos or enterprise github accounts # codeql: # uses: ./.github/workflows/codeql.yml diff --git a/.github/workflows/pushmain.yml b/.github/workflows/pushmain.yml index f45606ef3f..7a5990725d 100644 --- a/.github/workflows/pushmain.yml +++ b/.github/workflows/pushmain.yml @@ -20,8 +20,8 @@ concurrency: cancel-in-progress: false jobs: - build_test_release_tag: - uses: ./.github/workflows/build_test_release_tag.yml + bld_test_rel_tag: + uses: ./.github/workflows/bld_test_rel_tag.yml secrets: inherit # pass all secrets for pushing with: # NOTE: passing in a specific branch means that commits made during the pipeline before the final build is completed will be included diff --git a/.github/workflows/rel_tag.yml b/.github/workflows/rel_tag.yml index 6fb07a9ac4..f06dd0e507 100644 --- a/.github/workflows/rel_tag.yml +++ b/.github/workflows/rel_tag.yml @@ -64,7 +64,7 @@ jobs: ref: ${{ inputs.ref }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # token with write permissions to protected branches # standard github token does not allow this diff --git a/.github/workflows/temp-storybook.yml b/.github/workflows/temp-storybook.yml index 162eadcdbe..6c5b89fc76 100644 --- a/.github/workflows/temp-storybook.yml +++ b/.github/workflows/temp-storybook.yml @@ -11,8 +11,8 @@ jobs: build-and-deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 'v20.x' cache: 'yarn' @@ -20,7 +20,7 @@ jobs: run: | # Install npm packages and build the Storybook files yarn install yarn run build:storybook - - name: Deploy + - name: Deploy uses: JamesIves/github-pages-deploy-action@v4 with: - FOLDER: dist/storybook/ng-orcid # The folder that the build-storybook script generates files. \ No newline at end of file + FOLDER: dist/storybook/ng-orcid # The folder that the build-storybook script generates files. diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/test_yarn.yml similarity index 67% rename from .github/workflows/unit_tests.yml rename to .github/workflows/test_yarn.yml index dc35bb3d63..4e4ff0a919 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/test_yarn.yml @@ -2,14 +2,14 @@ on: workflow_call: workflow_dispatch: -name: unit_tests +name: test_yarn jobs: - unit_tests: + test_yarn: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 'v20.x' cache: 'yarn'