From 8f92973a524acea7d7ded04a9c7b3f6157330f81 Mon Sep 17 00:00:00 2001 From: Urvi Date: Mon, 1 Jul 2024 13:23:10 -0700 Subject: [PATCH 1/4] Create CI workflow for ledger exporter release --- .github/workflows/horizon.yml | 27 --------------- .github/workflows/ledgerexporter-release.yml | 36 ++++++++++++++++++++ .github/workflows/ledgerexporter.yml | 24 +++++++++++++ exp/services/ledgerexporter/Makefile | 2 +- 4 files changed, 61 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/ledgerexporter-release.yml create mode 100644 .github/workflows/ledgerexporter.yml diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 3ea92c8b17..cc3cf644f3 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -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 diff --git a/.github/workflows/ledgerexporter-release.yml b/.github/workflows/ledgerexporter-release.yml new file mode 100644 index 0000000000..8b4ca109d0 --- /dev/null +++ b/.github/workflows/ledgerexporter-release.yml @@ -0,0 +1,36 @@ +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.0.0-1872.c6f474133.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. + 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 diff --git a/.github/workflows/ledgerexporter.yml b/.github/workflows/ledgerexporter.yml new file mode 100644 index 0000000000..332a683e4a --- /dev/null +++ b/.github/workflows/ledgerexporter.yml @@ -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.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 + diff --git a/exp/services/ledgerexporter/Makefile b/exp/services/ledgerexporter/Makefile index 971fc3eb25..0d90a282c3 100644 --- a/exp/services/ledgerexporter/Makefile +++ b/exp/services/ledgerexporter/Makefile @@ -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: From 0d8724bdf09995dadf1e3fcf29d823ce075a96b7 Mon Sep 17 00:00:00 2001 From: Urvi Date: Tue, 2 Jul 2024 10:37:04 -0700 Subject: [PATCH 2/4] Bump stellar-core version --- .github/workflows/ledgerexporter-release.yml | 2 +- .github/workflows/ledgerexporter.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ledgerexporter-release.yml b/.github/workflows/ledgerexporter-release.yml index 8b4ca109d0..ede4cd1662 100644 --- a/.github/workflows/ledgerexporter-release.yml +++ b/.github/workflows/ledgerexporter-release.yml @@ -10,7 +10,7 @@ jobs: name: Test and push the Ledger Exporter images runs-on: ubuntu-latest env: - STELLAR_CORE_VERSION: 21.0.0-1872.c6f474133.focal + STELLAR_CORE_VERSION: 21.1.0-1921.b3aeb14cc.focal VERSION: ${GITHUB_REF_NAME#ledgerexporter-v} steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/ledgerexporter.yml b/.github/workflows/ledgerexporter.yml index 332a683e4a..63ae5e8128 100644 --- a/.github/workflows/ledgerexporter.yml +++ b/.github/workflows/ledgerexporter.yml @@ -10,7 +10,7 @@ jobs: name: Build and test Ledger Exporter image runs-on: ubuntu-latest env: - STELLAR_CORE_VERSION: 21.0.0-1872.c6f474133.focal + STELLAR_CORE_VERSION: 21.1.0-1921.b3aeb14cc.focal steps: - uses: actions/checkout@v3 with: From 92984419c797701269f2335daf6168cf76a20686 Mon Sep 17 00:00:00 2001 From: Urvi Date: Tue, 2 Jul 2024 10:57:47 -0700 Subject: [PATCH 3/4] Addressing review comments --- .github/workflows/ledgerexporter-release.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ledgerexporter-release.yml b/.github/workflows/ledgerexporter-release.yml index ede4cd1662..fe7bbfb19e 100644 --- a/.github/workflows/ledgerexporter-release.yml +++ b/.github/workflows/ledgerexporter-release.yml @@ -16,7 +16,7 @@ jobs: - 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 }} + ref: github.sha - name: Build Ledger Exporter docker run: make -C exp/services/ledgerexporter docker-build @@ -24,13 +24,11 @@ jobs: run: make -C exp/services/ledgerexporter docker-test # Push images - - if: github.ref == 'refs/heads/master' - name: Login to DockerHub + - 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 + - name: Push to DockerHub run: make -C exp/services/ledgerexporter docker-push From 4ff35877ac02d56e0b98a4957eecd1df5c305fb0 Mon Sep 17 00:00:00 2001 From: Urvi Date: Tue, 2 Jul 2024 11:32:38 -0700 Subject: [PATCH 4/4] addressing review comments --- .github/workflows/ledgerexporter-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ledgerexporter-release.yml b/.github/workflows/ledgerexporter-release.yml index fe7bbfb19e..9b23695c4a 100644 --- a/.github/workflows/ledgerexporter-release.yml +++ b/.github/workflows/ledgerexporter-release.yml @@ -15,7 +15,6 @@ jobs: 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.sha - name: Build Ledger Exporter docker run: make -C exp/services/ledgerexporter docker-build