Workflow file for this run
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
# Copyright 2023 JanusGraph Authors | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: Apply docker tags to the official JanusGraph release v0.6.4 | |
on: | |
push: | |
env: | |
LATEST_RELEASE: 0.6 | |
jobs: | |
tagging: | |
runs-on: ubuntu-22.04 | |
#if: "!contains(github.event.release.tag_name, '-') && !github.event.release.prerelease" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: EXTRACT VERSION | |
run: | | |
MINOR_VERSION=$(echo "v0.6.4" | grep -Eo '[0-9]+\.[0-9]+' | head -1) | |
PATCH_VERSION=$(echo "v0.6.4" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | head -1) | |
REVISION="6105d67" | |
echo "MINOR_VERSION=${MINOR_VERSION}" >> $GITHUB_ENV | |
echo "PATCH_VERSION=${PATCH_VERSION}" >> $GITHUB_ENV | |
echo "REVISION=${REVISION}" >> $GITHUB_ENV | |
#- name: Run minor tag for ghcr.io | |
# uses: shrink/actions-docker-registry-tag@v3 | |
# with: | |
# registry: ghcr.io | |
# repository: janusgraph/janusgraph | |
# target: ${{ env.PATCH_VERSION }}-${{ env.REVISION }} | |
# tags: | | |
# ${{ env.PATCH_VERSION }} | |
# ${{ env.MINOR_VERSION }} | |
#- name: Run latest tag for ghcr.io | |
# if: "env.MINOR_VERSION == '${{ env.LATEST_RELEASE }}'" | |
# uses: shrink/actions-docker-registry-tag@v3 | |
# with: | |
# registry: ghcr.io | |
# repository: janusgraph/janusgraph | |
# target: ${{ env.PATCH_VERSION }}-${{ env.REVISION }} | |
# tags: | | |
# latest | |
- name: GET DOCKER TOKEN | |
run: | | |
curl -u ${{ secrets.DOCKERHUB_USERNAME }}:${{ secrets.DOCKERHUB_TOKEN }} -s -o test.json "https://auth.docker.io/token?service=registry.docker.io&scope=repository:janusgraph/janusgraph:pull,push" | |
TOKEN=$(cat test.json | jq -r '.token') | |
echo "DOCKER_SHORT_TOKEN=${TOKEN}" >> $GITHUB_ENV | |
- name: Run minor tag for docker.io | |
uses: shrink/actions-docker-registry-tag@v3 | |
with: | |
registry: index.docker.io | |
repository: janusgraph/janusgraph | |
target: ${{ env.PATCH_VERSION }}-${{ env.REVISION }} | |
token: "${{ env.DOCKER_SHORT_TOKEN }}" | |
tags: | | |
${{ env.PATCH_VERSION }} | |
${{ env.MINOR_VERSION }} | |
- name: Run latest tag for docker.io | |
if: "env.MINOR_VERSION == '${{ env.LATEST_RELEASE }}'" | |
uses: shrink/actions-docker-registry-tag@v3 | |
with: | |
registry: index.docker.io | |
repository: janusgraph/janusgraph | |
target: ${{ env.PATCH_VERSION }}-${{ env.REVISION }} | |
token: ${{ secrets.DOCKER_SHORT_TOKEN }} | |
tags: | | |
latest |