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

refactor(ci): Make latest tag unstable and add stable release workflow #458

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
47 changes: 44 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ on:
- "v*.*.*" # run on semver tags
- "v*.*.*-*" # run on pre-release tags

workflow_dispatch:
inputs:
tag:
description: 'Tag to stable release'
required: true
default: 'v0.0.0'

jobs:
goreleaser:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Delete unnecessary tools folder for space
run: rm -rf /opt/hostedtoolcache
Expand Down Expand Up @@ -52,8 +60,8 @@ jobs:
push: true
build-args: |
- RELAYER_VERSION=${{ github.ref_name }}
tags: |
iconcommunity/centralized-relay:latest
tags:
iconcommunity/centralized-relay:unstable
iconcommunity/centralized-relay:${{ github.ref_name }}

- name: Install cosign
Expand All @@ -65,5 +73,38 @@ jobs:
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
COSIGN_YES: true
run: |
cosign sign --key env://COSIGN_PRIVATE_KEY iconcommunity/centralized-relay:latest
cosign sign --key env://COSIGN_PRIVATE_KEY iconcommunity/centralized-relay:unstable
cosign sign --key env://COSIGN_PRIVATE_KEY iconcommunity/centralized-relay:${{ github.ref_name }}

release:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Pull relayer image
run: docker pull iconcommunity/centralized-relay:${{ github.event.inputs.tag }}

- name: Tag with stable
run: docker tag iconcommunity/centralized-relay:${{ github.event.inputs.tag }} iconcommunity/centralized-relay:stable

- name: Push relayer image
run: docker push iconcommunity/centralized-relay:stable

- name: Install cosign
uses: sigstore/cosign-installer@v3

- name: Sign relayer image
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
COSIGN_YES: true
run: |
cosign sign --key env://COSIGN_PRIVATE_KEY iconcommunity/centralized-relay:stable
Loading