diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35ddcfe..bec0115 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 - uses: actions/setup-go@v3 with: go-version: 1.19 @@ -18,7 +20,7 @@ jobs: uses: goreleaser/goreleaser-action@v3 with: version: latest - args: release --skip-publish --rm-dist + args: release --snapshot --skip-publish --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35d64af..ced34f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,9 @@ jobs: goreleaser: name: Release Binaries runs-on: ubuntu-latest + # permissions: + # contents: write + # packages: write steps: - name: Checkout uses: actions/checkout@v3 @@ -26,22 +29,26 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to DockerHub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up QEMU uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - uses: actions/setup-go@v3 with: go-version: 1.19 - - name: Create and Push Tag + # only run this step when the tag is not already created - if: startsWith(github.ref, 'refs/tags/') != 'true' && github.event.inputs.tag != '' + - if: startsWith(github.ref, 'refs/tags/') != 'true' && github.event.inputs.tag != '' + name: Create and Push Tag run: |- git config --global user.email "23524935+Divkix@users.noreply.github.com" git config --global user.name "Divanshu Chauhan" @@ -51,6 +58,7 @@ jobs: fi git tag -a -m "Release $tag" "$tag" -f git push origin "$tag" + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v3 with: diff --git a/goreleaser.Dockerfile b/goreleaser.Dockerfile index ffc61a8..159a823 100644 --- a/goreleaser.Dockerfile +++ b/goreleaser.Dockerfile @@ -1,3 +1,3 @@ FROM golang:1.19 -COPY GIGA changelog.json /app/ -CMD ["/app/GigaUserbot"] +COPY giga changelog.json /app/ +CMD ["/app/giga"]