-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (118 loc) · 5.91 KB
/
linea-devnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: linea-devnet
on:
pull_request:
branches:
- main
workflow_call:
outputs:
workflow_run_id:
description: "the run id of the workflow"
value: ${{ jobs.build.outputs.workflow_run_id }}
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
environment: dockerhub
outputs:
workflow_run_id: ${{ steps.workflow_details.outputs.id }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: build the linea devnet artifacts
id: assemble
uses: ./.github/actions/assemble-devnet
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: login to docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER_RW }}
password: ${{ secrets.DOCKER_PASSWORD_RW }}
- name: set docker build args
run: |
echo "Building docker tag: ${{ steps.assemble.outputs.dockertag }}"
echo "Building docker image: ${{ steps.assemble.outputs.dockerimage }}"
- name: build and push the combined manifest
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_SUMMARY: false
with:
context: linea-besu/.
platforms: linux/arm64,linux/amd64
provenance: false
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
VERSION=${{ steps.assemble.outputs.dockertag }}
VCS_REF=${{ github.sha }}
BUILD_DATE=${{ steps.assemble.outputs.build_date }}
push: true
tags: |
consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }}
### release process artifacts
## adds one more tag :latest the above push on a release
- name: build and push the combined manifest
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_SUMMARY: false
with:
context: linea-besu/.
platforms: linux/arm64,linux/amd64
provenance: false
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
VERSION=${{ steps.assemble.outputs.dockertag }}
VCS_REF=${{ github.sha }}
BUILD_DATE=${{ steps.assemble.outputs.build_date }}
push: true
tags: |
consensys/linea-besu-package:devnet-latest
### release package artifacts
- name: release on tag - create artifacts for a release
if: startsWith(github.ref, 'refs/tags/v')
id: release_create_artifacts
run: |
mkdir release && cd release
tar -czvf linea-besu-${{ steps.assemble.outputs.dockertag }}.tar.gz ../linea-besu/
echo "## Release Artifact: Linea - devnet" > output.md
echo "linea-besu-${{ steps.assemble.outputs.dockertag }}.tar.gz" >> output.md
echo "SHA256: $(sha256sum linea-besu-${{ steps.assemble.outputs.dockertag }}.tar.gz | awk '{ print $1 }' )" >> output.md
echo "" >> output.md
echo "## Besu and Plugin Details" >> output.md
echo "| Module | Version | SHA-256 |" >> output.md
echo "|--------|---------|--------------|" >> output.md
echo "| linea-besu | ${{ steps.dotenv.outputs.LINEA_BESU_TAR_GZ }} | $(sha256sum /tmp/linea-besu-${{ steps.dotenv.outputs.LINEA_BESU_TAR_GZ }}.tar.gz | awk '{ print $1 }' ) |" >> output.md
echo "| linea-sequencer-plugin | ${{ steps.dotenv.outputs.LINEA_SEQUENCER_PLUGIN_VERSION }} | $(sha256sum ../linea-besu/besu/plugins/besu-sequencer-plugins-v${{ steps.dotenv.outputs.LINEA_SEQUENCER_PLUGIN_VERSION }}.jar | awk '{ print $1 }' ) |" >> output.md
echo "| linea-tracer-plugin | ${{ steps.dotenv.outputs.LINEA_TRACER_PLUGIN_VERSION }} | $(sha256sum ../linea-besu/besu/plugins/linea-tracer-v${{ steps.dotenv.outputs.LINEA_TRACER_PLUGIN_VERSION }}.jar | awk '{ print $1 }' ) |" >> output.md
echo "| linea-finalized-tag-updater-plugin | ${{ steps.dotenv.outputs.FINALIZED_TAG_UPDATER_PLUGIN_VERSION }} | $(sha256sum ../linea-besu/besu/plugins/finalized-tag-updater-v${{ steps.dotenv.outputs.FINALIZED_TAG_UPDATER_PLUGIN_VERSION }}.jar | awk '{ print $1 }' ) |" >> output.md
echo "| shomei-plugin | ${{ steps.dotenv.outputs.SHOMEI_PLUGIN_VERSION }} | $(sha256sum ../linea-besu/besu/plugins/besu-shomei-plugin-v${{ steps.dotenv.outputs.SHOMEI_PLUGIN_VERSION }}.jar | awk '{ print $1 }' ) |" >> output.md
echo "" >> output.md
MANIFEST=$(docker manifest inspect consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }})
if [ $? -eq 0 ]; then
echo "## Docker Image Details" >> output.md
echo "" >> output.md
echo "To pull the image, use the following command:" >> output.md
echo "\`\`\`" >> output.md
echo "docker pull consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }}" >> output.md
echo "\`\`\`" >> output.md
echo "" >> output.md
echo "| Digest | OS | Architecture |" >> output.md
echo "|--------|----|--------------|" >> output.md
echo "$MANIFEST" | jq -r '.manifests[] | select(.platform.architecture != "unknown" and .platform.os != "unknown") | "| \(.digest) | \(.platform.os) | \(.platform.architecture) |"' >> output.md
else
echo "Docker image consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }} does not exist on dockerhub"
exit 1
fi
- name: upload linea-devnet artifacts
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: linea-devnet
retention-days: 1
path: |
./release