diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..7c4749f --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -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 +