diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ef0180d..1d560d7 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,2 @@ +* @lidofinance/lido-eth-ui .github @lidofinance/review-gh-workflows diff --git a/.github/workflows/ci-prod.yml b/.github/workflows/ci-prod.yml index fb90bb9..c1ff9df 100644 --- a/.github/workflows/ci-prod.yml +++ b/.github/workflows/ci-prod.yml @@ -1,16 +1,10 @@ name: CI Build prod image on: - workflow_call: - inputs: - tag: - description: "tag to deploy from" - default: "" - required: false - type: string + release: + types: [released] -permissions: - contents: read +permissions: {} jobs: # test: @@ -21,27 +15,11 @@ jobs: # needs: test name: Build and deploy steps: - - name: Checkout - uses: actions/checkout@v3 - with: - persist-credentials: false - - - name: Tag name - id: tag_name - run: | - if [ "${{ inputs.tag }}" = "" ]; then - echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - else - echo "TAG=$TAG" >> $GITHUB_OUTPUT - fi - env: - TAG: ${{ inputs.tag }} - - name: Build prod image uses: lidofinance/dispatch-workflow@v1 env: APP_ID: ${{ secrets.APP_ID }} APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} TARGET_REPO: "lidofinance/infra-mainnet" - TAG: "${{ steps.tag_name.outputs.TAG }}" - TARGET_WORKFLOW: "build_mainnet_withdrawals_api.yaml" + TAG: "${{ github.event.release.tag_name }}" + TARGET_WORKFLOW: "build_mainnet_withdrawals_api.yaml" \ No newline at end of file diff --git a/.github/workflows/create-tag-and-trigger-deploy.yml b/.github/workflows/create-tag-and-trigger-deploy.yml deleted file mode 100644 index eac3077..0000000 --- a/.github/workflows/create-tag-and-trigger-deploy.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Create tag and trigger deploy -on: - push: - branches: - - main - -permissions: - contents: write - -jobs: - bump: - name: Create tag and release - runs-on: ubuntu-latest - if: "contains(github.event.head_commit.message, 'chore(release)')" - outputs: - tag: ${{ steps.tag.outputs.tag }} - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - persist-credentials: false - - name: Get tag value - id: tag - run: | - TAG="$(grep -oP '^chore\(release\).*\K(\d+\.\d+\.\d+)' <<< "$MESSAGE")" - echo "$TAG" - echo "tag=$TAG" >> $GITHUB_OUTPUT - env: - MESSAGE: ${{ github.event.head_commit.message }} - - name: Create and push tag - run: | - git tag ${{ steps.tag.outputs.tag }} - git push https://x-access-token:${{ github.token }}@github.com/$GITHUB_REPOSITORY --tags - - name: Create release - uses: lidofinance/action-gh-release@v1 - with: - tag_name: ${{ steps.tag.outputs.tag }} - - deploy-trigger: - needs: bump - name: Trigger build and PR creation in the infra-mainnet - if: "contains(github.event.head_commit.message, 'chore(release)')" - uses: ./.github/workflows/ci-prod.yml - secrets: inherit - with: - tag: ${{ needs.bump.outputs.tag }} diff --git a/.github/workflows/prepare-release-draft.yml b/.github/workflows/prepare-release-draft.yml new file mode 100644 index 0000000..4de99e1 --- /dev/null +++ b/.github/workflows/prepare-release-draft.yml @@ -0,0 +1,14 @@ +name: Prepare release draft +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + prepare-release-draft: + uses: lidofinance/actions/.github/workflows/prepare-release-draft.yml@main + with: + target: main \ No newline at end of file diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml deleted file mode 100644 index 8a474ba..0000000 --- a/.github/workflows/prepare-release.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Prepare release - -on: - workflow_dispatch: - -permissions: - contents: write - pull-requests: write - -jobs: - prepare-release: - name: Prepare release and create pre-release PR - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - persist-credentials: false - - - name: Bump version and update CHANGELOG.MD - id: changelog - uses: lidofinance/conventional-changelog-action@v3 - with: - git-message: "chore(release): {version}" - tag-prefix: "" - output-file: "CHANGELOG.md" - version-file: package.json - version-path: version - release-count: 10 # save all releases in the CHANGELOG.md - git-push: false - skip-on-empty: false - skip-ci: false - create-summary: true - - - name: Fail on missing args - if: ${{ !steps.changelog.outputs.version }} - run: > - echo "::error::No version output found for the prev step! Try restarting action" && exit 1 - - - name: Create Pull Request - uses: lidofinance/create-pull-request@v4 - if: ${{ steps.changelog.outputs.version }} - with: - branch: pre-release-${{ steps.changelog.outputs.version }} - title: "chore(release): ${{ steps.changelog.outputs.version }}" - body: "This PR is generated automatically.\nMerge it for the automatic tag creation.\nIf you don't need this PR than close it and **delete source branch**! " diff --git a/README.md b/README.md index a278f42..91e5760 100644 --- a/README.md +++ b/README.md @@ -34,15 +34,13 @@ $ yarn test:cov ## Release flow -To create new release: - -1. Merge all changes to the `main` branch -1. Navigate to Repo => Actions -1. Run action "Prepare release" action against `main` branch -1. When action execution is finished, navigate to Repo => Pull requests -1. Find pull request named "chore(release): X.X.X" review and merge it with "Rebase and merge" (or "Squash and merge") -1. After merge release action will be triggered automatically -1. Navigate to Repo => Actions and see last actions logs for further details +To create a new release: + +1. Merge all changes to the `main` branch. +1. After the merge, the `Prepare release draft` action will run automatically. When the action is complete, a release draft is created. +1. When you need to release, go to Repo → Releases. +1. Publish the desired release draft manually by clicking the edit button - this release is now the `Latest Published`. +1. After publication, the action to create a release bump will be triggered automatically. ## License