fix: analysis package #10
Workflow file for this run
This file contains hidden or 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: | |
tags: | |
- "v*" | |
# Cancel previous runs for the same workflow on the same tag | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
GO_VERSION: "1.24" | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: true | |
# - name: Install dependencies | |
# run: make ci-deps | |
# - name: Run tests | |
# run: make test | |
# - name: Run linter | |
# run: make lint | |
- name: Build | |
run: make build | |
- name: Generate changelog | |
id: changelog | |
run: | | |
if [ -f CHANGELOG.md ]; then | |
# Extract changelog for this version | |
VERSION=${GITHUB_REF#refs/tags/} | |
sed -n "/^## \[${VERSION}\]/,/^## \[/p" CHANGELOG.md | sed '$d' > RELEASE_CHANGELOG.md | |
else | |
echo "Release ${{ github.ref_name }}" > RELEASE_CHANGELOG.md | |
echo "" >> RELEASE_CHANGELOG.md | |
echo "See [commit history](https://github.com/${{ github.repository }}/commits/${{ github.ref_name }}) for details." >> RELEASE_CHANGELOG.md | |
fi | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ github.ref_name }} | |
name: Release ${{ github.ref_name }} | |
body_path: RELEASE_CHANGELOG.md | |
draft: false | |
prerelease: false | |
files: | | |
bin/gograph | |
token: ${{ secrets.GITHUB_TOKEN }} | |
docker-release: | |
name: Docker Release | |
runs-on: ubuntu-latest | |
needs: release | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- 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.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
tags: | | |
type=ref,event=tag | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |