From 7af6b544e59ead84a982b144ed7982cf6ec5d9ad Mon Sep 17 00:00:00 2001 From: Ty Hopp Date: Fri, 20 Sep 2024 23:32:22 +0800 Subject: [PATCH] chore: use single step in cd --- .github/workflows/cd.yml | 57 +++++++++++++++------------------------- 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index b7b1cb2..24de835 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -6,8 +6,12 @@ on: - main jobs: - setup: + cd: runs-on: ubuntu-latest + strategy: + matrix: + os: [linux, windows] + arch: [amd64, arm64] steps: - name: checkout-code uses: actions/checkout@v4 @@ -17,46 +21,27 @@ jobs: - name: install-deps run: make deps - - build: - needs: setup - runs-on: ubuntu-latest - strategy: - matrix: - os: [linux, windows] - arch: [amd64, arm64] - steps: - name: build run: | GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} make build - prepare: - needs: build - runs-on: ubuntu-latest - steps: - - name: get-version - run: make get-version - - name: check-tag-exists - run: make check-tag-exists - - name: create-github-release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.VERSION }} - release_name: Release ${{ env.VERSION }} - draft: false - prerelease: false + - name: get-version + run: make get-version + + - name: check-tag-exists + run: make check-tag-exists + + - name: create-github-release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.VERSION }} + release_name: Release ${{ env.VERSION }} + draft: false + prerelease: false - release: - needs: build - runs-on: ubuntu-latest - strategy: - matrix: - os: [linux, windows] - arch: [amd64, arm64] - steps: - name: upload-executable uses: actions/upload-release-asset@v1 env: