feat: add release workflow
This commit is contained in:
parent
2e0ed44f07
commit
2357a768ec
1 changed files with 66 additions and 0 deletions
66
.forgejo/workflows/release.yml
Normal file
66
.forgejo/workflows/release.yml
Normal 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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue