feat: add release workflow
All checks were successful
Release / build (eng) (push) Successful in 8s
Release / build (swe) (push) Successful in 8s
Release / publish (push) Successful in 14s

This commit is contained in:
Radu C. Martin 2025-04-02 13:49:44 +02:00
parent 2e0ed44f07
commit 2357a768ec

View file

@ -0,0 +1,66 @@
name: Release
on:
push:
tags:
- v*
env:
ARTIFACTS_PATH: artifacts
RELEASE_PATH: release
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
profile:
- eng # Engineering
- swe # Software Development
fail-fast: false # The resumes are independent
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Combine resume parts
run: |
mkdir ${{ env.ARTIFACTS_PATH }}
jq -s '.[0] * .[1]' json/{shared,headline-${{ matrix.profile }}}.json \
> ${{ env.ARTIFACTS_PATH }}/resume-${{ matrix.profile }}.json
- name: Upload artifacts
uses: forgejo/upload-artifact@v4 # temporary fork until actions/upload-artifact supports GHES
with:
name: json-resume-${{ matrix.profile }}
path: ${{ env.ARTIFACTS_PATH }}/
retention-days: 1
publish:
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# Needed so that download artifacts knows it's a local repo
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifacts
uses: forgejo/download-artifact@v4 # temporary fork until actions/download-artifact supports GHES
with:
path: ${{ env.ARTIFACTS_PATH }}/
- name: Combine artifacts
run: |
mkdir -p ${{ env.RELEASE_PATH }}
find ${{ env.ARTIFACTS_PATH }} -type f -name '*.json' -exec mv {} ${{ env.RELEASE_PATH }} \;
- name: Publish resumes
uses: actions/forgejo-release@v2.5.3
with:
direction: upload
sha: "${{ env.GITHUB_SHA }}"
release-dir: ${{ env.RELEASE_PATH }}
token: ${{ secrets.GITHUB_TOKEN }}
hide-archive-link: true