diff --git a/.github/workflows/build-legacy-relay.yml b/.github/workflows/build-legacy-relay.yml index 9ce2e04..f556205 100644 --- a/.github/workflows/build-legacy-relay.yml +++ b/.github/workflows/build-legacy-relay.yml @@ -7,6 +7,9 @@ on: - 'v[0-9]*' tags: - 'v*' + - 'mainnet' + - 'betanet' + - 'testnet' pull_request: workflow_dispatch: @@ -18,6 +21,7 @@ jobs: runs-on: ubuntu-latest outputs: matrix: ${{ steps.platforms.outputs.matrix }} + registry_image: ${{ steps.registry_image.outputs.registry_image }} steps: - name: Checkout uses: actions/checkout@v4 @@ -31,6 +35,19 @@ jobs: run: | echo ${{ steps.platforms.outputs.matrix }} + - name: Set Git Tag as Environment Variable + id: git_tag + run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Set Registry Image Based on Tag + if: startsWith(env.GIT_TAG, 'mainnet') || startsWith(env.GIT_TAG, 'betanet') || startsWith(env.GIT_TAG, 'testnet') + run: | + echo "REGISTRY_IMAGE=${{ env.REGISTRY_IMAGE }}-${{ env.GIT_TAG }}" >> $GITHUB_ENV + + - name: Set registry_image output + id: registry_image + run: echo "registry_image=${{ env.REGISTRY_IMAGE }}" >> $GITHUB_OUTPUT + - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -40,6 +57,7 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} type=semver,pattern={{version}} type=ref,event=pr + type=raw,value=latest,enable=${{ startsWith(env.GIT_TAG, 'mainnet') || startsWith(env.GIT_TAG, 'betanet') || startsWith(env.GIT_TAG, 'testnet') }} - name: Rename meta bake definition file run: | @@ -106,7 +124,7 @@ jobs: set: | *.tags= *.platform=${{ matrix.platform }} - *.output=type=image,"name=${{ env.REGISTRY_IMAGE }}",push-by-digest=true,name-canonical=true,push=true + *.output=type=image,"name=${{ needs.prepare.outputs.registry_image }}",push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | @@ -126,7 +144,13 @@ jobs: runs-on: ubuntu-latest needs: - build + - prepare steps: + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + - name: Download meta bake definition uses: actions/download-artifact@v4 with: @@ -153,9 +177,9 @@ jobs: - name: Create manifest list and push working-directory: /tmp/digests run: | - docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ env.REGISTRY_IMAGE }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ needs.prepare.outputs.registry_image }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \ + $(printf '${{ needs.prepare.outputs.registry_image }}@sha256:%s ' *) - name: Inspect image run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json) + docker buildx imagetools inspect ${{ needs.prepare.outputs.registry_image }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json) diff --git a/.github/workflows/build-participation.yml b/.github/workflows/build-participation.yml index 36d90f1..11ead1a 100644 --- a/.github/workflows/build-participation.yml +++ b/.github/workflows/build-participation.yml @@ -7,6 +7,9 @@ on: - 'v[0-9]*' tags: - 'v*' + - 'mainnet' + - 'betanet' + - 'testnet' pull_request: workflow_dispatch: @@ -18,6 +21,7 @@ jobs: runs-on: ubuntu-latest outputs: matrix: ${{ steps.platforms.outputs.matrix }} + registry_image: ${{ steps.registry_image.outputs.registry_image }} steps: - name: Checkout uses: actions/checkout@v4 @@ -31,6 +35,19 @@ jobs: run: | echo ${{ steps.platforms.outputs.matrix }} + - name: Set Git Tag as Environment Variable + id: git_tag + run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Set Registry Image Based on Tag + if: startsWith(env.GIT_TAG, 'mainnet') || startsWith(env.GIT_TAG, 'betanet') || startsWith(env.GIT_TAG, 'testnet') + run: | + echo "REGISTRY_IMAGE=${{ env.REGISTRY_IMAGE }}-${{ env.GIT_TAG }}" >> $GITHUB_ENV + + - name: Set registry_image output + id: registry_image + run: echo "registry_image=${{ env.REGISTRY_IMAGE }}" >> $GITHUB_OUTPUT + - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -40,6 +57,7 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} type=semver,pattern={{version}} type=ref,event=pr + type=raw,value=latest,enable=${{ startsWith(env.GIT_TAG, 'mainnet') || startsWith(env.GIT_TAG, 'betanet') || startsWith(env.GIT_TAG, 'testnet') }} - name: Rename meta bake definition file run: | @@ -106,7 +124,7 @@ jobs: set: | *.tags= *.platform=${{ matrix.platform }} - *.output=type=image,"name=${{ env.REGISTRY_IMAGE }}",push-by-digest=true,name-canonical=true,push=true + *.output=type=image,"name=${{ needs.prepare.outputs.registry_image }}",push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | @@ -126,7 +144,13 @@ jobs: runs-on: ubuntu-latest needs: - build + - prepare steps: + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + - name: Download meta bake definition uses: actions/download-artifact@v4 with: @@ -153,9 +177,9 @@ jobs: - name: Create manifest list and push working-directory: /tmp/digests run: | - docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ env.REGISTRY_IMAGE }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ needs.prepare.outputs.registry_image }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \ + $(printf '${{ needs.prepare.outputs.registry_image }}@sha256:%s ' *) - name: Inspect image run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json) \ No newline at end of file + docker buildx imagetools inspect ${{ needs.prepare.outputs.registry_image }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63d942f..db495cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,10 @@ on: - 'main' - 'v[0-9]*' tags: - - 'v*' + - 'v*' + - 'mainnet' + - 'betanet' + - 'testnet' pull_request: workflow_dispatch: @@ -18,6 +21,7 @@ jobs: runs-on: ubuntu-latest outputs: matrix: ${{ steps.platforms.outputs.matrix }} + registry_image: ${{ steps.registry_image.outputs.registry_image }} steps: - name: Checkout uses: actions/checkout@v4 @@ -31,6 +35,19 @@ jobs: run: | echo ${{ steps.platforms.outputs.matrix }} + - name: Set Git Tag as Environment Variable + id: git_tag + run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Set Registry Image Based on Tag + if: startsWith(env.GIT_TAG, 'mainnet') || startsWith(env.GIT_TAG, 'betanet') || startsWith(env.GIT_TAG, 'testnet') + run: | + echo "REGISTRY_IMAGE=${{ env.REGISTRY_IMAGE }}-${{ env.GIT_TAG }}" >> $GITHUB_ENV + + - name: Set registry_image output + id: registry_image + run: echo "registry_image=${{ env.REGISTRY_IMAGE }}" >> $GITHUB_OUTPUT + - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -40,6 +57,7 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} type=semver,pattern={{version}} type=ref,event=pr + type=raw,value=latest,enable=${{ startsWith(env.GIT_TAG, 'mainnet') || startsWith(env.GIT_TAG, 'betanet') || startsWith(env.GIT_TAG, 'testnet') }} - name: Rename meta bake definition file run: | @@ -106,7 +124,7 @@ jobs: set: | *.tags= *.platform=${{ matrix.platform }} - *.output=type=image,"name=${{ env.REGISTRY_IMAGE }}",push-by-digest=true,name-canonical=true,push=true + *.output=type=image,"name=${{ needs.prepare.outputs.registry_image }}",push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | @@ -126,7 +144,13 @@ jobs: runs-on: ubuntu-latest needs: - build + - prepare steps: + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + - name: Download meta bake definition uses: actions/download-artifact@v4 with: @@ -153,9 +177,9 @@ jobs: - name: Create manifest list and push working-directory: /tmp/digests run: | - docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ env.REGISTRY_IMAGE }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ needs.prepare.outputs.registry_image }}")) | "-t " + .) | join(" ")' /tmp/bake-meta.json) \ + $(printf '${{ needs.prepare.outputs.registry_image }}@sha256:%s ' *) - name: Inspect image run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json) + docker buildx imagetools inspect ${{ needs.prepare.outputs.registry_image }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json)