diff --git a/.github/actions/get-image-tag/action.yml b/.github/actions/get-image-tag/action.yml index b1234517b8..8ee539109d 100644 --- a/.github/actions/get-image-tag/action.yml +++ b/.github/actions/get-image-tag/action.yml @@ -16,6 +16,6 @@ runs: if [[ "${{ inputs.branch_name }}" == "master" ]]; then TAG_VERSION="$(jq -cr '.version' < package.json)" else - TAG_VERSION="${{ inputs.branch_name }}-${{ github.run_id }},${{ inputs.branch_name }}" + TAG_VERSION="${{ inputs.branch_name }}-${{ github.run_id }}" fi echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV diff --git a/.github/actions/publish-image/action.yml b/.github/actions/publish-image/action.yml index cc73ffbe3a..fb041b7cd4 100644 --- a/.github/actions/publish-image/action.yml +++ b/.github/actions/publish-image/action.yml @@ -5,23 +5,18 @@ inputs: registry: description: 'Docker registry' required: true - type: string username: description: 'login username' required: true - type: string password: description: 'login password' required: true - type: string - branch_name: - description: 'Name of the branch the workflow runs on' - required: true - type: string dry-run: - description: dry run flag + description: 'dry run flag' + required: true + tag_version: + description: 'tag version' required: true - type: boolean runs: using: "composite" @@ -39,11 +34,6 @@ runs: username: ${{ inputs.username }} password: ${{ inputs.password }} - - name: Get Tag - uses: ./.github/actions/get-image-tag - with: - branch_name: ${{ inputs.branch_name }} - - name: Install dependencies and build project shell: bash run: | @@ -55,5 +45,5 @@ runs: with: context: . platforms: linux/amd64,linux/arm64 - push: ${{ github.event.inputs.dry-run != 'true' }} - tags: ${{ inputs.registry }}/alfresco/alfresco-content-app:${{ env.TAG_VERSION }} + push: ${{ inputs.dry-run != 'true' }} + tags: ${{ inputs.registry }}/alfresco/alfresco-content-app:${{ inputs.tag_version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 565bdf73d2..c4f22620e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,11 +37,17 @@ jobs: node-version-file: '.nvmrc' cache: 'npm' - uses: ./.github/actions/setup + + - name: Get Tag + uses: ./.github/actions/get-image-tag + with: + branch_name: ${{ env.BRANCH_NAME }} + - name: publish uses: ./.github/actions/publish-image with: - branch_name: ${{ env.BRANCH_NAME }} registry: quay.io + tag_version: ${{ env.TAG_VERSION }} username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} dry-run: ${{ inputs.dry-run-release }} @@ -60,66 +66,17 @@ jobs: node-version-file: '.nvmrc' cache: 'npm' - uses: ./.github/actions/setup - - name: publish - uses: ./.github/actions/publish-image - with: - branch_name: ${{ env.BRANCH_NAME }} - registry: docker.io - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - dry-run: ${{ inputs.dry-run-release }} - publish-git-tag: - name: "Publish Git Tag" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Setup node - uses: actions/setup-node@v3 + - name: Get Tag + uses: ./.github/actions/get-image-tag with: - node-version-file: '.nvmrc' - cache: 'npm' - - uses: ./.github/actions/setup - - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.35.0 - with: - username: ${{ vars.BOT_GITHUB_USERNAME }} - email: ${{ vars.BOT_GITHUB_EMAIL }} - global: true - - name: publish - uses: ./.github/actions/git-tag - with: - github_token: ${{ secrets.GITHUB_TOKEN }} branch_name: ${{ env.BRANCH_NAME }} - dry-run: ${{ inputs.dry-run-release }} - - publish-libs: - name: "Publish libs to NPM and GitHub registry" - runs-on: ubuntu-latest - permissions: - packages: write - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: 'npm' - - - uses: ./.github/actions/setup - name: publish - uses: ./.github/actions/publish-libs + uses: ./.github/actions/publish-image with: - branch_name: ${{ env.BRANCH_NAME }} - github_token: ${{ secrets.BOT_GITHUB_TOKEN }} - npm_registry_address: ${{ vars.NPM_REGISTRY_ADDRESS }} - npm_registry_token: ${{ secrets.NPM_REGISTRY_TOKEN }} - npm_tag: ${{ env.TAG_NPM }} + registry: docker.io + tag_version: ${{ env.TAG_VERSION }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} dry-run: ${{ inputs.dry-run-release }}