zotero/.forgejo/workflows/generate-tarball.yml

52 lines
1.5 KiB
YAML

on:
workflow_dispatch:
inputs:
ref_name:
description: 'Tag or commit'
required: true
type: string
jobs:
build-tarball:
name: Build tarball w/ submodules
runs-on: x86_64
container:
image: alpine:latest
env:
CI_PROJECT_NAME: zotero
steps:
- name: Environment setup
run: apk add nodejs git git-archive-all gzip
- name: Repo pull
uses: actions/checkout@v4
with:
fetch-depth: 500
ref: ${{ inputs.ref_name }}
- name: Package build
run: |
echo "building tarball for ${{ inputs.ref_name }}"
git-archive-all --force-submodules $CI_PROJECT_NAME-${{ inputs.ref_name }}.tar.gz
echo "Generating sha512sum"
sha512sum $CI_PROJECT_NAME-${{ inputs.ref_name }}.tar.gz > $CI_PROJECT_NAME-${{ inputs.ref_name }}.tar.gz.sha512sum
- name: Package upload
uses: forgejo/upload-artifact@v3
with:
name: tarball
path: zotero-${{ inputs.ref_name }}.*
upload-release:
runs-on: x86_64
needs: [build-tarball]
container:
image: docker.io/node:20-bookworm
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 500
ref: ${{ inputs.ref_name }}
- uses: actions/forgejo-release@v1
with:
direction: upload
url: https://api.ayakael.net
token: ${{ secrets.CODE_FORGEJO_TOKEN }}
release-dir: ./
release-notes: "This release includes a fully buildable tarball"