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

Create CI workflow for ledger exporter release #5368

Merged
merged 4 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
27 changes: 0 additions & 27 deletions .github/workflows/horizon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,30 +149,3 @@ jobs:
name: Push to DockerHub
run: docker push stellar/horizon-verify-range:latest

ledger-exporter:
name: Test and push the Ledger Exporter images
runs-on: ubuntu-latest
env:
STELLAR_CORE_VERSION: 21.0.0-1872.c6f474133.focal
steps:
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Build Ledger Exporter docker
run: make -C exp/services/ledgerexporter docker-build

- name: Run Ledger Exporter test
run: make -C exp/services/ledgerexporter docker-test

# Push images
- if: github.ref == 'refs/heads/master'
name: Login to DockerHub
uses: docker/login-action@bb984efc561711aaa26e433c32c3521176eae55b
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- if: github.ref == 'refs/heads/master'
name: Push to DockerHub
run: make -C exp/services/ledgerexporter docker-push
34 changes: 34 additions & 0 deletions .github/workflows/ledgerexporter-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Ledger Exporter release

on:
push:
tags: ['ledgerexporter-v*']

jobs:

publish-docker:
urvisavla marked this conversation as resolved.
Show resolved Hide resolved
name: Test and push the Ledger Exporter images
runs-on: ubuntu-latest
env:
STELLAR_CORE_VERSION: 21.1.0-1921.b3aeb14cc.focal
VERSION: ${GITHUB_REF_NAME#ledgerexporter-v}
steps:
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
urvisavla marked this conversation as resolved.
Show resolved Hide resolved
ref: github.sha
- name: Build Ledger Exporter docker
run: make -C exp/services/ledgerexporter docker-build

- name: Run Ledger Exporter test
run: make -C exp/services/ledgerexporter docker-test

# Push images
- name: Login to DockerHub
uses: docker/login-action@bb984efc561711aaa26e433c32c3521176eae55b
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push to DockerHub
run: make -C exp/services/ledgerexporter docker-push
24 changes: 24 additions & 0 deletions .github/workflows/ledgerexporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: LedgerExporter

on:
push:
branches: [master]
pull_request:

jobs:
ledger-exporter:
name: Build and test Ledger Exporter image
runs-on: ubuntu-latest
env:
STELLAR_CORE_VERSION: 21.1.0-1921.b3aeb14cc.focal
steps:
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Build Ledger Exporter docker
run: make -C exp/services/ledgerexporter docker-build

- name: Run Ledger Exporter test
run: make -C exp/services/ledgerexporter docker-test

2 changes: 1 addition & 1 deletion exp/services/ledgerexporter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo")

# https://github.com/opencontainers/image-spec/blob/master/annotations.md
BUILD_DATE := $(shell date -u +%FT%TZ)
VERSION ?= 1.0.0-$(shell git rev-parse --short HEAD)
VERSION ?= $(shell git rev-parse --short HEAD)
chowbao marked this conversation as resolved.
Show resolved Hide resolved
DOCKER_IMAGE := stellar/ledger-exporter

docker-build:
Expand Down
Loading