Skip to content

Commit

Permalink
exp/services/ledgerexporter: create CI workflow for ledger exporter r…
Browse files Browse the repository at this point in the history
…elease (#5368)
  • Loading branch information
urvisavla committed Jul 2, 2024
1 parent 6eae569 commit 1885584
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 28 deletions.
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
33 changes: 33 additions & 0 deletions .github/workflows/ledgerexporter-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Ledger Exporter release

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

jobs:

publish-docker:
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:
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)
DOCKER_IMAGE := stellar/ledger-exporter

docker-build:
Expand Down

0 comments on commit 1885584

Please sign in to comment.