From d203d7f3e1c641f65baabecaff02db97e564befe Mon Sep 17 00:00:00 2001 From: Phu Ngo <12547020+NgoKimPhu@users.noreply.github.com> Date: Tue, 1 Oct 2024 02:58:28 +0700 Subject: [PATCH] chore: update release workflow --- .github/workflows/release.yaml | 27 +++++++++++++ .github/workflows/release.yml | 72 ---------------------------------- 2 files changed, 27 insertions(+), 72 deletions(-) create mode 100644 .github/workflows/release.yaml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000..d001b9ba4 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,27 @@ +name: 'Release' + +permissions: write-all + +on: + workflow_dispatch: + inputs: + version_bump: + description: 'Version bump type' + type: choice + options: + - patch + - minor + - major + default: patch + version: + description: 'Or specific release version' + type: string + +jobs: + release: + uses: KyberNetwork/service-framework/.github/workflows/release.yaml@main + with: + service: ${{ github.event.repository.name }} + version_bump: ${{ inputs.version_bump }} + version: ${{ inputs.version }} + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 0372d6f87..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: 'Release' - -permissions: write-all - -on: - workflow_dispatch: - inputs: - version: - description: 'Release version' - type: string - required: true - -jobs: - prepare: - runs-on: [ubuntu-22.04] - outputs: - version_tag: ${{ steps.version_tag.outputs.value }} - build_date: ${{ steps.build_date.outputs.value }} - steps: - - name: Check branch - if: ${{ !startsWith(github.ref, 'refs/heads/release') }} - run: | - echo "This workflow should be triggered with workflow_dispatch on release branch" - exit 1 - - name: Format version tag - shell: bash - id: version_tag - env: - INPUT_TAG: ${{ github.event.inputs.version }} - run: | - TAG=${INPUT_TAG#v} - echo "::set-output name=value::v$TAG" - - name: Build date - shell: bash - id: build_date - run: echo "::set-output name=value::$(date +%FT%T%z)" - - release: - needs: - - prepare - runs-on: [ ubuntu-22.04 ] - env: - VERSION_TAG: ${{ needs.prepare.outputs.version_tag }} - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: "1.21.x" - - - name: Setup Git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - - name: Create tag - run: | - git tag -d "$VERSION_TAG" 2> /dev/null || echo "Release tag '$VERSION_TAG' does NOT exist" - git tag --annotate --message "kyberswap-dex-lib $VERSION_TAG" "$VERSION_TAG" - git push origin "refs/tags/$VERSION_TAG" - - - name: Create release - uses: softprops/action-gh-release@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag_name: ${{ env.VERSION_TAG }} - prerelease: false - name: "Kyberswap Dex Lib ${{ env.VERSION_TAG }}"