Skip to content

Bump softprops/action-gh-release from 2 to 3 in the github-actions group across 1 directory #63

Bump softprops/action-gh-release from 2 to 3 in the github-actions group across 1 directory

Bump softprops/action-gh-release from 2 to 3 in the github-actions group across 1 directory #63

Workflow file for this run

name: Wait4X CI
on:
push:
branches:
- 'main'
- 'fnt'
- 'release/*'
tags:
- 'v*'
pull_request:
branches:
- '*'
permissions:
contents: read
packages: write
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
- name: go-fmt
run: make check-gofmt
- name: go-vet
run: make check-govet
- name: revive
run: |
go install github.com/mgechev/revive@v1.1.4
make check-revive
test:
name: Test
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
- name: Test Wait4X
run: make test
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@v1.2.0
with:
infile: coverage.out
outfile: coverage.lcov
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
build:
name: Build
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
statuses: write
steps:
- name: Checkout Code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: |
ghcr.io/${{ github.repository }}
# atkrad/wait4x
# wait4x/wait4x
### versioning strategy
### push semver tag v3.2.1 on the default branch
# wait4x/wait4x:2.2.0
# wait4x/wait4x:2.2
# wait4x/wait4x:2
# wait4x/wait4x:latest
# ghcr.io/wait4x/wait4x:2.2.0
# ghcr.io/wait4x/wait4x:2.2
# ghcr.io/wait4x/wait4x:2
# ghcr.io/wait4x/wait4x:latest
### push semver pre-release tag v3.0.0-beta.1 on the default branch
# wait4x/wait4x:3.0.0-beta.1
# ghcr.io/wait4x/wait4x:3.0.0-beta.1
### push on the default branch
# wait4x/wait4x:edge
# ghcr.io/wait4x/wait4x:edge
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=pr
type=edge,branch=${{ github.event.repository.default_branch }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
with:
buildkitd-config-inline: |
[worker.oci]
max-parallelism = 10
# - name: Login to Docker Hub (docker.io)
# if: ${{ github.event_name != 'pull_request' }}
# uses: docker/login-action@v4
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry (ghcr.io)
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build artifacts
uses: docker/bake-action@v7
with:
targets: artifact
provenance: false
set: |
*.args.COMMIT_HASH=${{ github.sha }}
*.args.COMMIT_REF_SLUG=${{ github.ref_name }}
- name: Move artifacts
run: |
# Move all files except SHA256SUMS to the main dist directory
find ./dist -type f -not -name "SHA256SUMS" -exec mv {} ./dist/ \;
# Combine all SHA256SUMS files into one
find ./dist -name "SHA256SUMS" -exec cat {} \; | sort -u > ./dist/SHA256SUMS.combined
mv ./dist/SHA256SUMS.combined ./dist/SHA256SUMS
# Remove empty directories
find ./dist -type d -empty -delete
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: wait4x-artifacts
path: ./dist/*
if-no-files-found: error
- name: Build images
uses: docker/bake-action@v7
with:
targets: image
push: ${{ github.ref_name == github.event.repository.default_branch || startsWith(github.ref, 'refs/tags/') }}
sbom: true
provenance: true
files: |
./docker-bake.hcl
cwd://${{ steps.meta.outputs.bake-file }}
# - name: Docker Hub Description
# uses: peter-evans/dockerhub-description@v5
# if: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch }}
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# short-description: ${{ github.event.repository.description }}
- name: GitHub Release
uses: softprops/action-gh-release@v3
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
draft: true
generate_release_notes: true
files: |
dist/*.tar.gz
dist/*.sha256sum
dist/SHA256SUMS
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}