feat: title detector (#180) #153
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
name: π Release | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
env: | |
IMAGE_NAME: vcspeaker.kt | |
jobs: | |
bump-version: | |
name: πΌ Bump version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.semantic.outputs.new_release_version }} | |
tag: ${{ steps.semantic.outputs.new_release_git_tag }} | |
changelog: ${{ steps.semantic.outputs.new_release_notes }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: πΌ Semantic Release | |
id: semantic | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
extra_plugins: | | |
conventional-changelog-conventionalcommits@^7.0.2 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
build-docker: | |
name: ποΈ Build Docker (${{ matrix.architecture }}) | |
runs-on: ubuntu-latest | |
needs: bump-version | |
strategy: | |
fail-fast: false | |
matrix: | |
architecture: [ amd64, arm64 ] | |
steps: | |
- name: π₯ Checkout ${{ github.repository }} | |
uses: actions/checkout@v4 | |
- name: π Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: ποΈ Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: π₯ Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: π Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5.5.1 | |
with: | |
images: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=raw,value=${{ needs.bump-version.outputs.version }}-${{ matrix.architecture }} | |
type=raw,value=latest-${{ matrix.architecture }} | |
- name: π Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
platforms: linux/${{ matrix.architecture }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
provenance: false | |
merge-latest: | |
name: π₯ Merge latest | |
runs-on: ubuntu-latest | |
needs: | |
- bump-version | |
- build-docker | |
steps: | |
- name: π₯ Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and push manifest images (latest) | |
uses: Noelware/docker-manifest-action@0.4.2 | |
with: | |
images: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest-amd64,ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest-arm64 | |
inputs: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest | |
push: true | |
- name: Create and push manifest images (version) | |
uses: Noelware/docker-manifest-action@0.4.2 | |
with: | |
images: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ needs.bump-version.outputs.version }}-amd64,ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ needs.bump-version.outputs.version }}-arm64 | |
inputs: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ needs.bump-version.outputs.version }} | |
push: true | |
create-release: | |
name: π¦ Create Release | |
runs-on: ubuntu-latest | |
needs: | |
- bump-version | |
- build-docker | |
- merge-latest | |
steps: | |
- name: β Setup Zulu JDK 17 | |
uses: actions/setup-java@v4.2.1 | |
with: | |
distribution: zulu | |
java-version: 17 | |
- name: π Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
with: | |
gradle-version: release-candidate | |
- name: π₯ Checkout ${{ github.repository }} | |
uses: actions/checkout@v4 | |
- name: β Restore caches | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: π Run Gradle command | |
run: | | |
gradle build | |
mv build/libs/*.jar build/libs/vcspeaker-kt.jar | |
- name: ποΈ Publish Release on main | |
uses: softprops/action-gh-release@v2 | |
with: | |
body: ${{ needs.bump-version.outputs.changelog }} | |
tag_name: ${{ needs.bump-version.outputs.tag }} | |
target_commitish: ${{ github.sha }} | |
files: | | |
build/libs/vcspeaker-kt.jar |