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

Give images pushed by CI version numbers #549

Merged
merged 16 commits into from
Jan 25, 2024
2 changes: 1 addition & 1 deletion .github/actions/push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runs:
using: "composite"
steps:
-
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
leighmcculloch marked this conversation as resolved.
Show resolved Hide resolved
with:
name: ${{ inputs.artifact_name }}
path: /tmp/
Expand Down
44 changes: 21 additions & 23 deletions .github/workflows/build-future.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,33 @@ name: Future
# software that have been informally released to the futurenet network.

on:
push:
branches:
- master
pull_request:

# Prevent more than one build of this workflow for a branch to be running at the
# same time, and if multiple are queued, only run the latest, cancelling any
# already running build. The exception being any protected branch, such as
# master, where a build for every commit will run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
cancel-in-progress: true
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: false
DOCKERHUB_TOKEN:
required: false
inputs:
sha:
description: 'Sha to build'
type: 'string'
required: true
tag-prefix:
description: 'Prefix for the tag name'
type: 'string'
default: ''

jobs:

complete:
if: always()
needs: [manifest]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1

amd64:
uses: ./.github/workflows/build.yml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
sha: ${{ inputs.sha }}
arch: amd64
tag: future-amd64
tag: ${{ inputs.tag-prefix }}future-amd64
xdr_ref: v20.0.2
core_ref: v20.1.0
core_supports_enable_soroban_diagnostic_events: "true"
Expand All @@ -52,8 +48,9 @@ jobs:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
sha: ${{ inputs.sha }}
arch: arm64
tag: future-arm64
tag: ${{ inputs.tag-prefix }}future-arm64
xdr_ref: v20.0.2
core_ref: v20.1.0
core_supports_enable_soroban_diagnostic_events: "true"
Expand All @@ -74,5 +71,6 @@ jobs:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
tag: future
tag: ${{ inputs.tag-prefix }}future
tag-alias: future
images: ${{ needs.amd64.outputs.image }} ${{ needs.arm64.outputs.image }}
44 changes: 21 additions & 23 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,33 @@ name: Latest
# tag for software that's been released which is not a release candidate.

on:
push:
branches:
- master
pull_request:

# Prevent more than one build of this workflow for a branch to be running at the
# same time, and if multiple are queued, only run the latest, cancelling any
# already running build. The exception being any protected branch, such as
# master, where a build for every commit will run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
cancel-in-progress: true
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: false
DOCKERHUB_TOKEN:
required: false
inputs:
sha:
description: 'Sha to build'
type: 'string'
required: true
tag-prefix:
description: 'Prefix for the tag name'
type: 'string'
default: ''

jobs:

complete:
if: always()
needs: [manifest]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1

amd64:
uses: ./.github/workflows/build.yml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
sha: ${{ inputs.sha }}
arch: amd64
tag: latest-amd64
tag: ${{ inputs.tag-prefix }}latest-amd64
xdr_ref: v20.0.2
core_ref: v20.1.0
go_ref: horizon-v2.27.0
Expand All @@ -55,8 +51,9 @@ jobs:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
sha: ${{ inputs.sha }}
arch: arm64
tag: latest-arm64
tag: ${{ inputs.tag-prefix }}latest-arm64
xdr_ref: v20.0.2
core_ref: v20.1.0
core_build_runner_type: ubuntu-latest-16-cores
Expand All @@ -79,5 +76,6 @@ jobs:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
tag: latest
tag: ${{ inputs.tag-prefix }}latest
tag-alias: latest
images: ${{ needs.amd64.outputs.image }} ${{ needs.arm64.outputs.image }}
69 changes: 69 additions & 0 deletions .github/workflows/build-start.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build

on:
push:
branches:
- master
pull_request:

# Prevent more than one build of this workflow for a branch to be running at the
# same time, and if multiple are queued, only run the latest, cancelling any
# already running build. The exception being any protected branch, such as
# master, where a build for every commit will run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
cancel-in-progress: true

jobs:

complete:
if: always()
needs: [latest, testing, future]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1

setup:
runs-on: ubuntu-latest
outputs:
tag-prefix: ${{ steps.tag-prefix.outputs.tag-prefix }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Get all history for the sha count below.
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- id: tag-prefix
run: |
count="$(git rev-list HEAD --count --first-parent)"
echo "tag-prefix=v${count}-" >> $GITHUB_OUTPUT

latest:
needs: [setup]
uses: ./.github/workflows/build-latest.yml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
sha: ${{ github.event.pull_request.head.sha || github.sha }}
tag-prefix: ${{ needs.setup.outputs.tag-prefix }}

testing:
needs: [setup]
uses: ./.github/workflows/build-testing.yml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
sha: ${{ github.event.pull_request.head.sha || github.sha }}
tag-prefix: ${{ needs.setup.outputs.tag-prefix }}

future:
needs: [setup]
uses: ./.github/workflows/build-future.yml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
sha: ${{ github.event.pull_request.head.sha || github.sha }}
tag-prefix: ${{ needs.setup.outputs.tag-prefix }}
44 changes: 21 additions & 23 deletions .github/workflows/build-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,33 @@ name: Testing
# release.

on:
push:
branches:
- master
pull_request:

# Prevent more than one build of this workflow for a branch to be running at the
# same time, and if multiple are queued, only run the latest, cancelling any
# already running build. The exception being any protected branch, such as
# master, where a build for every commit will run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
cancel-in-progress: true
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: false
DOCKERHUB_TOKEN:
required: false
inputs:
sha:
description: 'Sha to build'
type: 'string'
required: true
tag-prefix:
description: 'Prefix for the tag name'
type: 'string'
default: ''

jobs:

complete:
if: always()
needs: [manifest]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1

amd64:
uses: ./.github/workflows/build.yml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
sha: ${{ inputs.sha }}
arch: amd64
tag: testing-amd64
tag: ${{ inputs.tag-prefix }}testing-amd64
xdr_ref: v20.0.2
core_ref: v20.1.0
core_supports_enable_soroban_diagnostic_events: "true"
Expand All @@ -57,8 +53,9 @@ jobs:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
sha: ${{ inputs.sha }}
arch: arm64
tag: testing-arm64
tag: ${{ inputs.tag-prefix }}testing-arm64
xdr_ref: v20.0.2
core_ref: v20.1.0
core_supports_enable_soroban_diagnostic_events: "true"
Expand All @@ -82,5 +79,6 @@ jobs:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
tag: testing
tag: ${{ inputs.tag-prefix }}testing
tag-alias: testing
images: ${{ needs.amd64.outputs.image }} ${{ needs.arm64.outputs.image }}
Loading
Loading