From 4ced8c58927eaf124af5eb4c46f161d93ee3de36 Mon Sep 17 00:00:00 2001 From: lpmatos Date: Sat, 24 Sep 2022 10:58:54 -0300 Subject: [PATCH] ci(issue-#132): add new workflow to gorelease --- .github/workflows/release.yml | 91 ----------------------------------- 1 file changed, 91 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 4b35583..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Release - -on: - workflow_dispatch: - inputs: - git-ref: - description: Git Ref - default: main - required: true - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - if: github.event.inputs.git-ref == 'main' - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 'lts/*' - if: github.event.inputs.git-ref == 'main' - - - name: Install dependencies - run: npm install - if: github.event.inputs.git-ref == 'main' - - - name: Release - run: npx semantic-release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: github.event.inputs.git-ref == 'main' - - goreleaser: - name: "GoReleaser" - needs: release - runs-on: ubuntu-20.04 - - steps: - - name: Checkout - uses: actions/checkout@v3.0.2 - with: - fetch-depth: 0 - - - name: Get Details - id: get_details - run: | - echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/} - echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} - echo ::set-output name=SOURCE_TAG::$(git tag --sort=committerdate | tail -1) - echo ::set-output name=GOVERSION::$(cat .go-version) - - - name: List tags - run: | - git tag --list - - - name: Show variables - run: | - echo $SOURCE_NAME - echo $SOURCE_BRANCH - echo $SOURCE_TAG - env: - SOURCE_NAME: ${{ steps.get_details.outputs.SOURCE_NAME }} - SOURCE_BRANCH: ${{ steps.get_details.outputs.SOURCE_BRANCH }} - SOURCE_TAG: ${{ steps.get_details.outputs.SOURCE_TAG }} - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: ${{ steps.get_details.outputs.GOVERSION }} - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v3 - with: - args: release --rm-dist - env: - CLIENT_VERSION: ${{ steps.get_details.outputs.SOURCE_TAG }} - GO_VERSION: ${{ steps.get_details.outputs.GOVERSION }} - GORELEASER_CURRENT_TAG: ${{ steps.get_details.outputs.SOURCE_TAG }} - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - GIT_BRANCH: ${{ steps.get_details.outputs.SOURCE_BRANCH }} - - - name: Upload assets - uses: actions/upload-artifact@v3 - with: - name: loli - path: dist/*