From 9528f8d6ddf07bc7f2ca947248e858b423d7329d Mon Sep 17 00:00:00 2001 From: Kelly Hofmann <55991524+k3llymariee@users.noreply.github.com> Date: Tue, 12 Mar 2024 15:12:32 -0700 Subject: [PATCH] feat: create binaries in GitHub actions (#9) * ci: add publish action to release-please workflow * feat: add required go-versions * remove unnecessary setup steps, go-versions --- .github/actions/publish/action.yml | 19 +++++++------------ .github/workflows/release-please.yml | 23 ++++++++++++++++++++++- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index 0ceecbbc..606d47e2 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -15,19 +15,14 @@ inputs: runs: using: composite steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Checkout + uses: actions/checkout@v4 with: - platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/386 - - name: Git clean - shell: bash - run: git clean -f - - name: Login to Docker - shell: bash - run: | - echo $DOCKER_TOKEN | docker login --username $DOCKER_USERNAME --password-stdin + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable - name: Run Goreleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index a1270084..12a1523c 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -6,6 +6,7 @@ on: - main jobs: + release-please: runs-on: ubuntu-latest outputs: @@ -16,4 +17,24 @@ jobs: id: release with: token: ${{secrets.GITHUB_TOKEN}} - release-type: "go" \ No newline at end of file + release-type: "go" + + release-ldcli: + permissions: + id-token: write # Needed to obtain Docker tokens + contents: write # Needed to upload release artifacts + + needs: [ release-please ] +# if: ${{ needs.release-please.outputs.release_created == 'true' }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: ./.github/actions/publish + with: + dry-run: 'true' + token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ needs.release-please.outputs.tag_name }} \ No newline at end of file