-
Notifications
You must be signed in to change notification settings - Fork 260
chore: docker workflow refactor #2820
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
Merged
Merged
Changes from 16 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
ae4db56
chore: docker workflow refactor
auricom 4450668
factorize image tag
auricom ee4cf3d
permissions
auricom 11b9797
remove workflow dispatch
auricom 7c7fba0
docker job can only be called by ci_release workflow
auricom a8e26bf
permission
auricom 4f5f756
Potential fix for code scanning alert no. 145: Workflow does not contβ¦
auricom 6b740fd
tag
auricom fa932c4
permissions
auricom 8df4b4b
optim
auricom dfa9266
chore: reorg dockerfiles
auricom 15daa50
docker tags for apps
auricom dd4a854
release is not created
auricom 71ce4ca
docs
auricom 52a0c80
perm
auricom e9f72a8
Merge branch 'main' into claude/docker_rework
auricom db4c064
fix permissions
auricom ec03c9c
permissions
auricom 15799e8
fix readme
auricom 0baeed0
lint
auricom fe3dded
lint
auricom 89a8296
hadolint
auricom 3440dcb
lint
auricom 009ab68
lint
auricom af13741
release
auricom be661cb
hadolint
auricom 616347b
alpine 3.22.2
auricom 4cb7bbe
fix
auricom e95423b
fix
auricom a81ba54
fix
auricom b6bca3e
md
auricom 5d38f73
release
auricom 14f8f8d
Merge branch 'main' into claude/docker_rework
auricom 811e200
fix
auricom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,231 @@ | ||
| # Quick Start: Release Guide | ||
|
|
||
| This is a quick reference guide for releasing ev-node components. For detailed documentation, see: | ||
| - **Workflow Details**: [.github/workflows/README.md](workflows/README.md) | ||
| - **Complete Release Process**: [RELEASE.md](../RELEASE.md) | ||
|
|
||
| ## Docker Image Release (Recommended for Apps) | ||
|
|
||
| ### When to Use | ||
| Release deployable applications (EVM nodes, test apps, etc.) as Docker images. | ||
|
|
||
| ### Quick Steps | ||
|
|
||
| ```bash | ||
| # 1. Ensure CI passes on main | ||
| # 2. Create and push tag | ||
| git tag evm/single/v0.2.0 | ||
| git push origin evm/single/v0.2.0 | ||
|
|
||
| # 3. Monitor workflow | ||
| # GitHub β Actions β Release workflow | ||
|
|
||
| # 4. Verify release | ||
| docker pull ghcr.io/evstack/ev-node-evm-single:v0.2.0 | ||
| ``` | ||
|
|
||
| ### Tag Format | ||
| `{app-path}/v{major}.{minor}.{patch}` | ||
|
|
||
| **Examples:** | ||
| - `evm/single/v0.2.0` β Releases `apps/evm/single/` | ||
| - `testapp/v1.0.0` β Releases `apps/testapp/` | ||
| - `grpc/single/v2.1.3` β Releases `apps/grpc/single/` | ||
|
|
||
| ### What Happens Automatically | ||
| 1. β Validates tag and app directory | ||
| 2. β Builds multi-platform Docker image (amd64, arm64) | ||
| 3. β Publishes to GHCR: | ||
| - Version tag: `ghcr.io/evstack/ev-node-{app}:v0.2.0` | ||
| - Latest tag: `ghcr.io/evstack/ev-node-{app}:latest` | ||
|
|
||
| ### Requirements | ||
| - App directory exists: `./apps/{app-path}/` | ||
| - Dockerfile exists: `./apps/{app-path}/Dockerfile` | ||
| - Tag format: `**/v*.*.*` | ||
| - CI passes on main branch | ||
|
|
||
| --- | ||
|
|
||
| ## Go Module Release (For Libraries) | ||
|
|
||
| ### When to Use | ||
| Release Go library packages (core, da, sequencers, etc.) for use as dependencies. | ||
|
|
||
| ### Quick Steps | ||
|
|
||
| ```bash | ||
| # 1. Release in dependency order | ||
| # 2. Wait for Go proxy propagation between releases | ||
| # 3. Update dependent modules before releasing them | ||
|
|
||
| # Example: Release core module | ||
| cd core | ||
| git tag core/v0.3.0 | ||
| git push origin core/v0.3.0 | ||
|
|
||
| # Wait 5-10 minutes for Go proxy | ||
| go list -m github.com/evstack/ev-node/core@v0.3.0 | ||
| ``` | ||
|
|
||
| ### Release Order | ||
| 1. **Phase 1**: `core` (no dependencies) | ||
| 2. **Phase 2**: `da`, `ev-node`, `execution/evm` (depend on core) | ||
| 3. **Phase 3**: `sequencers/*` (depend on core + ev-node) | ||
| 4. **Phase 4**: `apps/*` (depend on all previous) | ||
|
|
||
| **See [RELEASE.md](../RELEASE.md#go-module-releases-manual) for complete dependency graph and detailed steps.** | ||
|
|
||
| --- | ||
|
|
||
| ## Common Release Scenarios | ||
|
|
||
| ### Scenario 1: Release Single App (Docker) | ||
| ```bash | ||
| # Tag and push | ||
| git tag evm/single/v0.2.0 | ||
| git push origin evm/single/v0.2.0 | ||
|
|
||
| # Done! Automated workflow handles the rest | ||
| ``` | ||
|
|
||
| ### Scenario 2: Release Multiple Apps | ||
| ```bash | ||
| # Release apps independently | ||
| git tag evm/single/v0.2.0 | ||
| git tag testapp/v1.0.0 | ||
| git push origin evm/single/v0.2.0 testapp/v1.0.0 | ||
|
|
||
| # Each triggers its own workflow | ||
| ``` | ||
|
|
||
| ### Scenario 3: Full Go Module Release | ||
| ```bash | ||
| # 1. Core | ||
| git tag core/v0.3.0 && git push origin core/v0.3.0 | ||
|
|
||
| # 2. Wait 5-10 min, then first-level deps | ||
| git tag da/v0.3.0 && git push origin da/v0.3.0 | ||
| git tag v0.3.0 && git push origin v0.3.0 | ||
| git tag execution/evm/v0.3.0 && git push origin execution/evm/v0.3.0 | ||
|
|
||
| # 3. Wait, then sequencers | ||
| git tag sequencers/single/v0.3.0 && git push origin sequencers/single/v0.3.0 | ||
|
|
||
| # 4. Wait, then apps | ||
| git tag apps/evm/single/v0.3.0 && git push origin apps/evm/single/v0.3.0 | ||
| ``` | ||
|
|
||
| ### Scenario 4: Hotfix/Rollback | ||
| ```bash | ||
| # Delete bad tag | ||
| git tag -d evm/single/v0.2.0 | ||
| git push origin :refs/tags/evm/single/v0.2.0 | ||
|
|
||
| # Fix code, create new tag | ||
| git tag evm/single/v0.2.1 | ||
| git push origin evm/single/v0.2.1 | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Verification | ||
|
|
||
| ### Docker Image Release | ||
| ```bash | ||
| # Check workflow status | ||
| # GitHub β Actions β Release | ||
|
|
||
| # Pull and test image | ||
| docker pull ghcr.io/evstack/ev-node-evm-single:v0.2.0 | ||
| docker run ghcr.io/evstack/ev-node-evm-single:v0.2.0 --version | ||
|
|
||
| # Check GHCR | ||
| # GitHub β Packages β ev-node-evm-single | ||
| ``` | ||
|
|
||
| ### Go Module Release | ||
| ```bash | ||
| # Verify module is available | ||
| go list -m github.com/evstack/ev-node/core@v0.3.0 | ||
|
|
||
| # Test in a consumer project | ||
| go get github.com/evstack/ev-node/core@v0.3.0 | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### "App directory does not exist" | ||
| - Ensure tag matches app path: `apps/evm/single/` β `evm/single/v0.2.0` | ||
| - Check spelling and case sensitivity | ||
|
|
||
| ### "Dockerfile not found" | ||
| - Verify Dockerfile exists at `apps/{app-path}/Dockerfile` | ||
| - Check file name is exactly `Dockerfile` | ||
|
|
||
| ### "Image not found" in tests | ||
| - Wait for Docker build workflow to complete | ||
| - Check workflow dependencies in Actions tab | ||
|
|
||
| ### Go proxy delay | ||
| - Wait 5-30 minutes for propagation | ||
| - Use `go list -m` to verify availability | ||
| - Check https://proxy.golang.org/ | ||
|
|
||
| --- | ||
|
|
||
| ## Best Practices | ||
|
|
||
| ### Before Releasing | ||
|
|
||
| - β All changes merged to `main` | ||
| - β CI workflow passes | ||
| - β CHANGELOG.md updated | ||
| - β Documentation updated | ||
| - β Local testing complete | ||
|
|
||
| ### Semantic Versioning | ||
|
|
||
| - **Major (v2.0.0)**: Breaking changes | ||
| - **Minor (v1.1.0)**: New features, backward compatible | ||
| - **Patch (v1.0.1)**: Bug fixes, backward compatible | ||
|
|
||
| ### Tag Messages | ||
|
|
||
| ```bash | ||
| # Good: Annotated tag with description | ||
| git tag -a evm/single/v0.2.0 -m "Release EVM single v0.2.0 | ||
|
|
||
| Features: | ||
| - Added feature X | ||
| - Improved performance Y | ||
|
|
||
| Bug fixes: | ||
| - Fixed issue Z | ||
| " | ||
|
|
||
| # Avoid: Lightweight tag without description | ||
| git tag evm/single/v0.2.0 # Less informative | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Quick Links | ||
|
|
||
| - **Workflow Details**: [.github/workflows/README.md](workflows/README.md) | ||
| - **Complete Release Process**: [RELEASE.md](../RELEASE.md) | ||
| - **CI Workflow**: [.github/workflows/ci.yml](workflows/ci.yml) | ||
| - **Release Workflow**: [.github/workflows/release.yml](workflows/release.yml) | ||
| - **GitHub Actions**: https://github.com/evstack/ev-node/actions | ||
| - **GitHub Packages**: https://github.com/orgs/evstack/packages | ||
|
|
||
| --- | ||
|
|
||
| ## Need Help? | ||
|
|
||
| 1. **Workflow documentation**: See [.github/workflows/README.md](workflows/README.md) | ||
| 2. **Release process**: See [RELEASE.md](../RELEASE.md) | ||
| 3. **CI failures**: Check GitHub Actions logs | ||
| 4. **Questions**: Open an issue or discussion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| name: CI | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| merge_group: | ||
|
|
||
| permissions: {} | ||
| jobs: | ||
| determine-image-tag: | ||
| name: Determine Image Tag | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| tag: ${{ steps.set-tag.outputs.tag }} | ||
| steps: | ||
| - name: Set image tag | ||
| id: set-tag | ||
| run: | | ||
| if [ -n "${{ github.event.pull_request.number }}" ]; then | ||
| TAG="pr-${{ github.event.pull_request.number }}" | ||
| echo "::notice::Using PR-based tag: $TAG" | ||
| else | ||
| # Sanitize ref_name by replacing / with - | ||
| TAG="${{ github.ref_name }}" | ||
| TAG="${TAG//\//-}" | ||
| echo "::notice::Using branch/tag-based tag: $TAG" | ||
| fi | ||
|
|
||
| # Validate tag format | ||
| if [[ ! "$TAG" =~ ^[a-zA-Z0-9._-]+$ ]]; then | ||
| echo "::error::Invalid image tag format: $TAG" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "tag=$TAG" >> $GITHUB_OUTPUT | ||
|
|
||
| lint: | ||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/lint.yml | ||
|
|
||
| docker: | ||
| needs: determine-image-tag | ||
| uses: ./.github/workflows/docker.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| with: | ||
| image-tag: ${{ needs.determine-image-tag.outputs.tag }} | ||
| apps: | | ||
| [ | ||
| {"name": "ev-node-evm-single", "dockerfile": "apps/evm/single/Dockerfile"} | ||
| ] | ||
|
|
||
| test: | ||
| needs: determine-image-tag | ||
|
auricom marked this conversation as resolved.
Outdated
|
||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/test.yml | ||
| secrets: inherit | ||
| with: | ||
| image-tag: ${{ needs.determine-image-tag.outputs.tag }} | ||
|
|
||
| docker-tests: | ||
| needs: [determine-image-tag, docker] | ||
| uses: ./.github/workflows/docker-tests.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
| with: | ||
| image-tag: ${{ needs.determine-image-tag.outputs.tag }} | ||
|
|
||
| proto: | ||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/proto.yml | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.