Release Bot #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Release Bot | |
# Run manually | |
on: workflow_dispatch | |
jobs: | |
build: | |
env: | |
CI: true | |
SENTRY_ORG: duncte123 | |
SENTRY_PROJECT: dunctebot | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.ref }}-release | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: './' | |
fetch-depth: 0 | |
- name: Set up java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 21 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Grant execute permission for sentry | |
run: chmod +x ./.github/sentry.sh | |
- name: Build with Gradle | |
run: ./gradlew --no-daemon :bot:lintAll :bot:build | |
- name: Release sentry | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
run: ./.github/sentry.sh | |
- name: Release bot | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew --no-daemon :bot:shadowJar :bot:githubRelease | |
build_docker: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.ref }}-docker-release | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: './' | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Github packages | |
uses: docker/login-action@v2 | |
with: | |
username: duncte123 | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v3 | |
with: | |
file: ./bot/Dockerfile | |
context: ./ | |
push: true | |
tags: dunctebot/skybot:latest | |
cache-from: type=gha | |
cache-to: type=gha | |
build-args: | | |
is_ci=true | |
git_sha=${{ github.sha }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |