Skip to content

Merge pull request #5 from snkrdunk/tagpr-from-v0.65.2 #7

Merge pull request #5 from snkrdunk/tagpr-from-v0.65.2

Merge pull request #5 from snkrdunk/tagpr-from-v0.65.2 #7

Workflow file for this run

name: tagpr
on:
push:
branches:
- main
workflow_dispatch:
jobs:
tagpr:
runs-on: ubuntu-latest
outputs:
tagpr-tag: ${{ steps.run-tagpr.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
cache: true
- id: run-tagpr
name: Run tagpr
uses: Songmu/tagpr@e89d37247ca73d3e5620bf074a53fbd5b39e66b0 # v1.5.1
darwin-assets:
name: Release assets for maoOS
needs: tagpr
if: needs.tagpr.outputs.tagpr-tag != ''
runs-on: macos-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
with:
distribution: goreleaser
version: latest
args: --config .goreleaser/darwin.yml --clean --skip=publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
run: |
gh release upload ${{ needs.tagpr.outputs.tagpr-tag }} dist/octocov_*.zip dist/checksums-darwin.txt --repo ${{ github.repository }} --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux-assets:
name: Release assets for Linux
needs: tagpr
if: needs.tagpr.outputs.tagpr-tag != ''
runs-on: ubuntu-latest
steps:
- name: Set up gcc-aarch64-linux-gnu
run: |
sudo apt-get update || true
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Check out source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
with:
distribution: goreleaser
version: latest
args: --config .goreleaser/linux.yml --clean --skip=publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
run: |
gh release upload ${{ needs.tagpr.outputs.tagpr-tag }} dist/octocov_*.tar.gz dist/octocov_*.apk dist/octocov_*.deb dist/octocov_*.rpm dist/checksums-linux.txt --repo ${{ github.repository }} --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
windows-assets:
name: Release assets for Windows
needs: tagpr
if: needs.tagpr.outputs.tagpr-tag != ''
runs-on: windows-latest
steps:
- name: Use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
with:
distribution: goreleaser
version: latest
args: --config .goreleaser/windows.yml --clean --skip=publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
run: |
gh release upload ${{ needs.tagpr.outputs.tagpr-tag }} dist/octocov_${{ needs.tagpr.outputs.tagpr-tag }}_windows_arm64.zip dist/octocov_${{ needs.tagpr.outputs.tagpr-tag }}_windows_amd64.zip dist/checksums-windows.txt --repo ${{ github.repository }} --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dockerimage:
needs: tagpr
if: needs.tagpr.outputs.tagpr-tag != ''
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get latest version
id: latest_version
run: |
echo -n 'version=' > $GITHUB_OUTPUT
gh release list --limit 1 | cut -f 1 >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
- name: Login to ghcr.io
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ steps.latest_version.outputs.version }}
ghcr.io/${{ github.repository }}:latest
labels: |
org.opencontainers.image.name=octocov
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ steps.latest_version.outputs.version }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}
release:
needs: [tagpr, darwin-assets, linux-assets, windows-assets, dockerimage]
runs-on: ubuntu-latest
steps:
- name: Release
run: |
gh api /repos/${{ github.repository }}/releases/generate-notes -f tag_name=${{ needs.tagpr.outputs.tagpr-tag }} --jq .body | gh release edit ${{ needs.tagpr.outputs.tagpr-tag }} --repo ${{ github.repository }} --draft=false --latest --notes-file=-
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}