-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add workflow for docker image push (#52)
* feat: add workflow for docker image push * chore: update workflow name
- Loading branch information
1 parent
a000ea7
commit 534d8f0
Showing
17 changed files
with
201 additions
and
140 deletions.
There are no files selected for viewing
This file contains 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,31 @@ | ||
name: Build, Lint, and Test | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build-lint-test: | ||
name: Build, Lint, and Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build with Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "npm" | ||
- run: npm install --no-package-lock | ||
- run: npm install --save-dev @nomicfoundation/solidity-analyzer-linux-x64-gnu @nx/nx-linux-x64-gnu | ||
- name: Build | ||
run: npm run build | ||
- name: Lint | ||
run: npm run lint | ||
- name: Test | ||
run: npm run test | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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,48 @@ | ||
name: Create Release Pull Request | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
base-branch: | ||
description: "The base branch for git operations and the pull request." | ||
default: "main" | ||
required: true | ||
release-version: | ||
description: "A specific version to bump to, i.e. 0.1.1" | ||
required: true | ||
|
||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # setting GH_TOKEN for the entire workflow | ||
|
||
jobs: | ||
create-release-pr: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Configure Git identity | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "GitHub Actions" | ||
- name: Create release branch | ||
run: | | ||
branch_name="release/v${{ github.event.inputs.release-version }}" | ||
git checkout -b $branch_name | ||
git commit --allow-empty -m "Release v${{ github.event.inputs.release-version }}" | ||
git push origin $branch_name | ||
echo "::set-output name=branch_name::$branch_name" | ||
- name: Open Pull Request | ||
run: | | ||
gh pr create --base ${{ github.event.inputs.base-branch }} --head "release/v${{ github.event.inputs.release-version }}" --title "Release v${{ github.event.inputs.release-version }}" --body "Automated release PR for version v${{ github.event.inputs.release-version }}" |
This file contains 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,64 @@ | ||
name: Main | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
jobs: | ||
build-lint-test: | ||
uses: ./.github/workflows/build-lint-test.yml | ||
|
||
compliance: | ||
uses: ./.github/workflows/compliance.yml | ||
|
||
all-jobs-completed: | ||
name: All jobs completed | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-lint-test | ||
outputs: | ||
PASSED: ${{ steps.set-output.outputs.PASSED }} | ||
steps: | ||
- name: Set PASSED output | ||
id: set-output | ||
run: echo "PASSED=true" >> "$GITHUB_OUTPUT" | ||
|
||
all-jobs-pass: | ||
name: All jobs pass | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
needs: all-jobs-completed | ||
steps: | ||
- name: Check that all jobs have passed | ||
run: | | ||
passed="${{ needs.all-jobs-completed.outputs.PASSED }}" | ||
if [[ $passed != "true" ]]; then | ||
exit 1 | ||
fi | ||
is-release: | ||
# Filtering by `push` events ensures that we only release from the `main` branch, which is a | ||
# requirement for our npm publishing environment. | ||
# The commit author should always be 'github-actions' for releases created by the | ||
# 'create-release-pr' workflow, so we filter by that as well to prevent accidentally | ||
# triggering a release. | ||
if: github.event_name == 'push' && startsWith(github.event.head_commit.author.name, 'github-actions') | ||
needs: all-jobs-pass | ||
outputs: | ||
IS_RELEASE: ${{ steps.is-release.outputs.IS_RELEASE }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: MetaMask/action-is-release@v1 | ||
id: is-release | ||
|
||
publish-release: | ||
needs: is-release | ||
if: needs.is-release.outputs.IS_RELEASE == 'true' | ||
name: Publish Release transeptor docker image | ||
permissions: | ||
contents: write | ||
uses: ./.github/workflows/publish-release.yml | ||
secrets: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} |
This file contains 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,38 @@ | ||
name: Publish Release transeptor docker image | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
DOCKER_USERNAME: | ||
required: true | ||
DOCKER_PASSWORD: | ||
required: true | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Get package version | ||
id: get_version | ||
run: echo version=$(node -p "require('./package.json').version") >> $GITHUB_OUTPUT | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64,linux/arm64/v8 | ||
file: ./Dockerfile | ||
push: true | ||
tags: | | ||
transeptorlabs/bundler:${{ steps.get_version.outputs.version }} | ||
transeptorlabs/bundler:latest |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "root", | ||
"version": "0.5.0-alpha.0", | ||
"author": { | ||
"name": "Transeptor Labs", | ||
"email": "[email protected]", | ||
|
@@ -14,7 +15,6 @@ | |
"bugs": { | ||
"url": "https://github.com/transeptorlabs/transeptor-bundler/issues" | ||
}, | ||
"private": true, | ||
"scripts": { | ||
"///ab": "_____________________________________________________________________", | ||
"///cv": "________________________WELCOME BUILDERS______________________________", | ||
|
This file contains 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
This file contains 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
Oops, something went wrong.