Skip to content

fix: hardcoded "Fire" tribe #33

fix: hardcoded "Fire" tribe

fix: hardcoded "Fire" tribe #33

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME_PREFIX: ${{ github.repository }}
jobs:
update-repo-version:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v6
- name: Extract version from tag
id: get_version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
ci:
needs: [update-repo-version]
uses: ./.github/workflows/ci.yml
permissions:
contents: read
actions: write
packages: write
with:
is_release: true
version: ${{ needs.update-repo-version.outputs.version }}
build-and-push:
needs: [ci, update-repo-version]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- context: src/backend
image_name: void-eid-backend
dockerfile: Dockerfile
artifact_name: backend-bin
download_path: .
- context: src/frontend
image_name: void-eid-frontend
dockerfile: Dockerfile.release
artifact_name: frontend-dist
download_path: dist
- context: src/murmur
image_name: void-eid-murmur
dockerfile: Dockerfile
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Patch files with version
run: |
VERSION=${{ needs.update-repo-version.outputs.version }}
sed -i 's/^version = ".*"/version = "'"$VERSION"'"/' src/backend/Cargo.toml
sed -i 's/"version": ".*"/"version": "'"$VERSION"'"/' src/frontend/package.json
- name: Download artifact
if: ${{ matrix.artifact_name != '' }}
uses: actions/download-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.context }}/${{ matrix.download_path }}
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/${{ matrix.image_name }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.context }}/${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
create-release:
needs: [ci, update-repo-version]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Download backend artifact
uses: actions/download-artifact@v4
with:
name: backend-bin
path: release-assets/backend
- name: Download frontend artifact
uses: actions/download-artifact@v4
with:
name: frontend-dist
path: release-assets/frontend
- name: Package artifacts
run: |
VERSION=${{ needs.update-repo-version.outputs.version }}
# Backend
cd release-assets/backend
tar -czvf ../../void-eid-backend-${VERSION}.tar.gz *
cd ../..
# Frontend
cd release-assets/frontend
tar -czvf ../../void-eid-frontend-${VERSION}.tar.gz *
cd ../..
- name: Generate Changelog
id: changelog
run: |
# Get the previous tag
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -z "$PREV_TAG" ]; then
echo "No previous tag found, generating changelog for all commits"
git log --pretty=format:"* %s (%h)" > CHANGELOG.md
else
echo "Generating changelog since $PREV_TAG"
echo "## Changes since $PREV_TAG" > CHANGELOG.md
git log --pretty=format:"* %s (%h)" $PREV_TAG..HEAD >> CHANGELOG.md
fi
echo "path=CHANGELOG.md" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body_path: ${{ steps.changelog.outputs.path }}
files: |
void-eid-backend-*.tar.gz
void-eid-frontend-*.tar.gz
draft: false
prerelease: false