diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..f627cd0e --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,5 @@ +template: | + ## What's Changed + $CHANGES + + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..e84156a5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Release Drafter and Publisher + +on: + push: + tags: + - v* + +permissions: + contents: read + +jobs: + new_release: + permissions: + # write permission is required to create a github release + contents: write + # write permission is required for autolabeler + # otherwise, read permission is required at least + pull-requests: write + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + # ${{ github.ref }} was not giving v* as tag name, but refs/tags/v* instead, so I had to abbreviate it + - name: Get latest abbreviated tag + id: gettag + run: echo ::set-output name=TAG::$(git describe --tags --abbrev=7) + + - uses: release-drafter/release-drafter@v5 + with: + commitish: master + name: "stellar-etl ${{ steps.gettag.outputs.TAG }}" + tag: ${{ github.ref }} + publish: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/internal/transform/operation.go b/internal/transform/operation.go index 5a6d1463..f42bbf06 100644 --- a/internal/transform/operation.go +++ b/internal/transform/operation.go @@ -66,18 +66,17 @@ func TransformOperation(operation xdr.Operation, operationIndex int32, transacti return OperationOutput{}, err } - outputOperationResults, ok := transaction.Result.Result.OperationResults() - if !ok { - return OperationOutput{}, err - } - - outputOperationResultCode := outputOperationResults[operationIndex].Code.String() + var outputOperationResultCode string var outputOperationTraceCode string - operationResultTr, ok := outputOperationResults[operationIndex].GetTr() + outputOperationResults, ok := transaction.Result.Result.OperationResults() if ok { - outputOperationTraceCode, err = mapOperationTrace(operationResultTr) - if err != nil { - return OperationOutput{}, err + outputOperationResultCode = outputOperationResults[operationIndex].Code.String() + operationResultTr, ok := outputOperationResults[operationIndex].GetTr() + if ok { + outputOperationTraceCode, err = mapOperationTrace(operationResultTr) + if err != nil { + return OperationOutput{}, err + } } } diff --git a/internal/transform/transaction.go b/internal/transform/transaction.go index 60a1a2b2..9d105bf4 100644 --- a/internal/transform/transaction.go +++ b/internal/transform/transaction.go @@ -170,7 +170,7 @@ func TransformTransaction(transaction ingest.LedgerTransaction, lhe xdr.LedgerHe } // TODO: FeeCharged is calculated incorrectly in protocol 20. Remove when protocol is updated and the bug is fixed - outputFeeCharged = outputFeeCharged - outputResourceFeeRefund + outputFeeCharged = outputResourceFee - outputResourceFeeRefund + outputInclusionFeeCharged } outputCloseTime, err := utils.TimePointToUTCTimeStamp(ledgerHeader.ScpValue.CloseTime)