feat: 登録削除コマンド "vcspeaker remove" の追加 (#173) #150
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 |