Skip to content

chore: bump docker/build-push-action from 4 to 5 (#103) #118

chore: bump docker/build-push-action from 4 to 5 (#103)

chore: bump docker/build-push-action from 4 to 5 (#103) #118

Workflow file for this run

name: Release
on:
push:
branches:
- 'main'
permissions:
contents: write
packages: write
jobs:
qa:
name: Release
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: '0'
token: ${{ secrets.TOKEN_GITHUB_TO_GITHUB_REPOSITORIES_RW }}
- name: Login to GitHub container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Use Go
uses: actions/setup-go@v4
with:
go-version: '1.18'
- name: Configure action to use Dockerfile for local execution
run: |
cat ./action.yml.tpl | sed "s/<docker-image>/Dockerfile/" > ./action.yml
- name: Get next version
id: get_next_version
uses: ./
- name: Set new image version in action.yml
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
run: |
cat ./action.yml.tpl | sed "s/<docker-image>/docker:\/\/ghcr.io\/thenativeweb\/get-next-version:${{ steps.get_next_version.outputs.version }}/" > ./action.yml
- name: Create release commit
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
uses: EndBug/add-and-commit@v9
with:
add: ./action.yml
message: "chore(release): Version ${{ steps.get_next_version.outputs.version }} [skip ci]"
default_author: github_actions
- name: Create new version
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
run: |
NEXT_VERSION=${{ steps.get_next_version.outputs.version }}
git tag $NEXT_VERSION
git push origin $NEXT_VERSION
- name: Build artifacts
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
run: |
make build-all
- name: Release new version
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
uses: ncipollo/release-action@v1
with:
artifacts: "build/*"
tag: ${{ steps.get_next_version.outputs.version }}
- name: Set up QEMU
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
uses: docker/setup-buildx-action@v3
- name: Build and push docker image
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/thenativeweb/get-next-version:latest,ghcr.io/thenativeweb/get-next-version:${{steps.get_next_version.outputs.version}}