Skip to content

Merge pull request #46 from ponkio-o/fix-login-username #5

Merge pull request #46 from ponkio-o/fix-login-username

Merge pull request #46 from ponkio-o/fix-login-username #5

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
jobs:
# Build first because some Dockerfiles depend on the builder image
build-and-push-builder:
name: Build and push container image (builder)
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Login to ghcr.io
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
platforms: linux/amd64,linux/arm64
file: build.Dockerfile
tags: |
ghcr.io/dena/unity-meta-check/unity-meta-check-builder:${{ github.ref_name }}
ghcr.io/dena/unity-meta-check/unity-meta-check-builder:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
build-and-push:
name: Build and push container image
needs: build-and-push-builder
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
images:
- dockerfile: ./Dockerfile
image_name: ghcr.io/dena/unity-meta-check/unity-meta-check
- dockerfile: ./.github/images/Dockerfile
image_name: ghcr.io/dena/unity-meta-check/unity-meta-check-gh-action
- dockerfile: ./.circleci/images/Dockerfile
image_name: ghcr.io/dena/unity-meta-check/unity-meta-check-circleci
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
submodules: recursive
- uses: nowsprinting/check-version-format-action@98485692a883d962227b09f40f29a63de0771299 # v4.0.2
id: version
with:
prefix: "v"
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Login to ghcr.io
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
platforms: linux/amd64,linux/arm64
file: ${{ matrix.images.dockerfile }}
tags: ${{ matrix.images.image_name }}:${{ github.ref_name }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Add latest tag
if: steps.version.outputs.is_stable == 'true'
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
platforms: linux/amd64,linux/arm64
file: ${{ matrix.images.dockerfile }}
tags: ${{ matrix.images.image_name }}:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
release-binaries:
name: Build and release binaries
runs-on: ubuntu-latest
permissions:
# Required to write release assets
contents: write
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
submodules: recursive
- name: Install aqua
uses: aquaproj/aqua-installer@4551ec64e21bf0f557c2525135ff0bd2cba40ec7 # v3.0.0
with:
aqua_version: v2.27.3
- uses: nowsprinting/check-version-format-action@98485692a883d962227b09f40f29a63de0771299 # v4.0.2
id: version
with:
prefix: "v"
- name: Create pre-release
if: steps.version.outputs.is_stable != 'true'
run: gh release create --prerelease --title ${{ github.ref_name }} ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
if: steps.version.outputs.is_stable == 'true'
run: gh release create --latest --title ${{ github.ref_name }} ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run goreleaser
run: goreleaser release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}