Skip to content

Commit

Permalink
ci: setup qemu and login to registries for push
Browse files Browse the repository at this point in the history
  • Loading branch information
Divkix committed Sep 5, 2022
1 parent 8ecdb81 commit 219108f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ 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
- name: Run GoReleaser
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 }}

12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 "[email protected]"
git config --global user.name "Divanshu Chauhan"
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions goreleaser.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM golang:1.19
COPY GIGA changelog.json /app/
CMD ["/app/GigaUserbot"]
COPY giga changelog.json /app/
CMD ["/app/giga"]

0 comments on commit 219108f

Please sign in to comment.