From 6a249cb844670091f40d77420f221e95cc85c067 Mon Sep 17 00:00:00 2001 From: Amisha Singla Date: Mon, 28 Oct 2024 12:29:44 -0500 Subject: [PATCH 1/2] Update github workflow to update changelog on every PR merge (#286) * update github workflow to write changelog Update changelog and commit Test on push test with github action as username update test test Update CHANGELOG.md for PR #286 update format add new changelog to the top append and not overwrite Add more info to changelog * Use major/minor/patch instead of release/minor/patch; Default to patch in case branch name not prefixed accordingly * Run release drafter only on PR merge to master * lint lint * only major and minor * Update CHANGELOG.md --- .github/pull_request_template.md | 2 +- .github/workflows/release.yml | 30 ++++++++++++++++++++++----- CHANGELOG.md | 35 ++++++++++++++++++++++++++++++++ README.md | 4 ++-- 4 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 34a4b107..b4d58ed2 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -20,7 +20,7 @@ change is, and why it is being made, with enough context for anyone to understan ### Release planning - [ ] I've decided if this PR requires a new major/minor/patch version accordingly to - [semver](https://semver.org/), and I've changed the name of the BRANCH to release/_ , feature/_ or patch/\* . + [semver](https://semver.org/), and I've changed the name of the BRANCH to major/_ , minor/_ or patch/\* . ### What diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f222509..ff068667 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,8 @@ name: Release Drafter and Publisher on: pull_request: - types: [closed] + types: + - closed concurrency: group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }} @@ -13,7 +14,7 @@ permissions: jobs: new_release: - if: github.event.pull_request.merged == true + if: github.ref == 'refs/heads/master' && github.event.pull_request.merged == true permissions: # write permission is required to create a github release contents: write @@ -44,19 +45,38 @@ jobs: CURRENT_VERSION="${{ steps.gettag.outputs.TAG }}" CURRENT_VERSION="${CURRENT_VERSION#v}" # Remove the 'v' from the start of the version IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION" - if [[ $BRANCH_NAME =~ ^release/ ]]; then + if [[ $BRANCH_NAME =~ ^major/ ]]; then VERSION_PARTS[0]=$((VERSION_PARTS[0] + 1)) VERSION_PARTS[1]=0 VERSION_PARTS[2]=0 - elif [[ $BRANCH_NAME =~ ^feature/ ]]; then + elif [[ $BRANCH_NAME =~ ^minor/ ]]; then VERSION_PARTS[1]=$((VERSION_PARTS[1] + 1)) VERSION_PARTS[2]=0 - elif [[ $BRANCH_NAME =~ ^patch/ ]]; then + else VERSION_PARTS[2]=$((VERSION_PARTS[2] + 1)) fi NEXT_VERSION="v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}" echo ::set-output name=NEXT_VERSION::"$NEXT_VERSION" + - name: Update CHANGELOG.md + run: | + EXISTING_CHANGELOG=$(cat CHANGELOG.md) + echo " " > CHANGELOG.md + echo "## ${{ steps.nextversion.outputs.NEXT_VERSION }}" >> CHANGELOG.md + echo "- ${{ github.event.pull_request.title }} (#${{ github.event.pull_request.number }}) @${{ github.event.pull_request.user.login }}" >> CHANGELOG.md + echo " " >> CHANGELOG.md + echo -e "$EXISTING_CHANGELOG" >> CHANGELOG.md + + - name: Commit changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add CHANGELOG.md + git commit -m "Update CHANGELOG.md for PR #${{ github.event.pull_request.number }}" + + - name: Push changes + run: git push origin HEAD:master + - name: Create and publish new tag run: | git tag ${{ steps.nextversion.outputs.NEXT_VERSION }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..ffbb4597 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,35 @@ +## v2.0.0 + +- Release/CI enhancements (#247) @laysabit +- Update readme (#245) @chowbao +- Create codeql.yml (#243) @kanwalpreetd +- Update to latest stellar/go change with updated ledgerexporter zstd (#244) @chowbao +- Update to use BufferedStorageBackend to read txmeta files (#242) @chowbao +- Add contract code fees (#241) @chowbao +- Add fee fields; formatting for warnings (#240) @chowbao +- adding ledgerbackend datastore txmeta as a data source (#235) @chowbao +- Feature/change workdir (#238) @edualvess +- Add `ledger_key_hash` to `history_operations` (#237) @lucaszanotelli +- Bump google.golang.org/protobuf from 1.32.0 to 1.33.0 (#232) @dependabot +- Fix operation trace code bug (#236) @chowbao +- Fix fee charged calculation (#234) @chowbao +- Release drafter and publisher (#233) @laysabit +- Update soroban fees (#231) @chowbao +- Add case for null operationResultTr for operation_trace_code (#230) @chowbao +- Enable diagnostic events (#229) @chowbao +- Log Transaction Codes and Operation Traces (#228) @sydneynotthecity + +## v1.0.0 + +- Update stellar-core version by @chowbao in https://github.com/stellar/stellar-etl/pull/216 +- doc : commented functions in cmd and internal/input folder by @laysabit in https://github.com/stellar/stellar-etl/pull/217 +- Add user agent to captive core config by @chowbao in https://github.com/stellar/stellar-etl/pull/219 +- Add export all history command by @chowbao in https://github.com/stellar/stellar-etl/pull/220 +- Add OperationTypeManageSellOffer operation type to history_assets export by @cayod in https://github.com/stellar/stellar-etl/pull/214 +- Export_assets fix by @cayod in https://github.com/stellar/stellar-etl/pull/222 +- Update core image for testnet reset by @chowbao in https://github.com/stellar/stellar-etl/pull/223 +- use NewLedgerChangeReaderFromLedgerCloseMeta by @sfsf9797 in https://github.com/stellar/stellar-etl/pull/221 +- Fix contract data balance holder by @chowbao in https://github.com/stellar/stellar-etl/pull/225 +- Revert "Fix contract data balance holder" by @chowbao in https://github.com/stellar/stellar-etl/pull/226 +- Add common interface to write exported files by @chowbao in https://github.com/stellar/stellar-etl/pull/215 +- Fix soroban hashes to hexstring by @chowbao in https://github.com/stellar/stellar-etl/pull/227 diff --git a/README.md b/README.md index b2c59333..b5ff5779 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ The Stellar-ETL is a data pipeline that allows users to extract data from the hi Pay attention, it is very important to know if your modification to this repository is a release (breaking changes), a feature (functionalities) or a patch(to fix bugs). With that information, create your branch name like this: -- `release/` -- `feature/` +- `major/` +- `minor/` - `patch/` If branch is already made, just rename it _before passing the pull request_. From c0557613fe8f3679f034da560adbf388f817a648 Mon Sep 17 00:00:00 2001 From: Amisha Singla Date: Mon, 28 Oct 2024 16:16:16 -0500 Subject: [PATCH 2/2] Just use release drafter changelog meh (#287) --- .github/workflows/release.yml | 19 ------------------ CHANGELOG.md | 36 +---------------------------------- 2 files changed, 1 insertion(+), 54 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff068667..462dd9bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,25 +58,6 @@ jobs: NEXT_VERSION="v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}" echo ::set-output name=NEXT_VERSION::"$NEXT_VERSION" - - name: Update CHANGELOG.md - run: | - EXISTING_CHANGELOG=$(cat CHANGELOG.md) - echo " " > CHANGELOG.md - echo "## ${{ steps.nextversion.outputs.NEXT_VERSION }}" >> CHANGELOG.md - echo "- ${{ github.event.pull_request.title }} (#${{ github.event.pull_request.number }}) @${{ github.event.pull_request.user.login }}" >> CHANGELOG.md - echo " " >> CHANGELOG.md - echo -e "$EXISTING_CHANGELOG" >> CHANGELOG.md - - - name: Commit changes - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add CHANGELOG.md - git commit -m "Update CHANGELOG.md for PR #${{ github.event.pull_request.number }}" - - - name: Push changes - run: git push origin HEAD:master - - name: Create and publish new tag run: | git tag ${{ steps.nextversion.outputs.NEXT_VERSION }} diff --git a/CHANGELOG.md b/CHANGELOG.md index ffbb4597..50d8a8ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,35 +1 @@ -## v2.0.0 - -- Release/CI enhancements (#247) @laysabit -- Update readme (#245) @chowbao -- Create codeql.yml (#243) @kanwalpreetd -- Update to latest stellar/go change with updated ledgerexporter zstd (#244) @chowbao -- Update to use BufferedStorageBackend to read txmeta files (#242) @chowbao -- Add contract code fees (#241) @chowbao -- Add fee fields; formatting for warnings (#240) @chowbao -- adding ledgerbackend datastore txmeta as a data source (#235) @chowbao -- Feature/change workdir (#238) @edualvess -- Add `ledger_key_hash` to `history_operations` (#237) @lucaszanotelli -- Bump google.golang.org/protobuf from 1.32.0 to 1.33.0 (#232) @dependabot -- Fix operation trace code bug (#236) @chowbao -- Fix fee charged calculation (#234) @chowbao -- Release drafter and publisher (#233) @laysabit -- Update soroban fees (#231) @chowbao -- Add case for null operationResultTr for operation_trace_code (#230) @chowbao -- Enable diagnostic events (#229) @chowbao -- Log Transaction Codes and Operation Traces (#228) @sydneynotthecity - -## v1.0.0 - -- Update stellar-core version by @chowbao in https://github.com/stellar/stellar-etl/pull/216 -- doc : commented functions in cmd and internal/input folder by @laysabit in https://github.com/stellar/stellar-etl/pull/217 -- Add user agent to captive core config by @chowbao in https://github.com/stellar/stellar-etl/pull/219 -- Add export all history command by @chowbao in https://github.com/stellar/stellar-etl/pull/220 -- Add OperationTypeManageSellOffer operation type to history_assets export by @cayod in https://github.com/stellar/stellar-etl/pull/214 -- Export_assets fix by @cayod in https://github.com/stellar/stellar-etl/pull/222 -- Update core image for testnet reset by @chowbao in https://github.com/stellar/stellar-etl/pull/223 -- use NewLedgerChangeReaderFromLedgerCloseMeta by @sfsf9797 in https://github.com/stellar/stellar-etl/pull/221 -- Fix contract data balance holder by @chowbao in https://github.com/stellar/stellar-etl/pull/225 -- Revert "Fix contract data balance holder" by @chowbao in https://github.com/stellar/stellar-etl/pull/226 -- Add common interface to write exported files by @chowbao in https://github.com/stellar/stellar-etl/pull/215 -- Fix soroban hashes to hexstring by @chowbao in https://github.com/stellar/stellar-etl/pull/227 +Please refer to https://github.com/stellar/stellar-etl/releases