2024-08-12 03:37:29 +00:00
|
|
|
on:
|
2024-08-12 03:49:15 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
ref_name:
|
|
|
|
description: 'Tag or commit'
|
|
|
|
required: true
|
|
|
|
type: string
|
2024-08-12 03:23:25 +00:00
|
|
|
|
2024-09-09 23:42:13 +00:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
|
2024-08-12 03:23:25 +00:00
|
|
|
jobs:
|
2024-08-12 05:25:33 +00:00
|
|
|
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: |
|
2024-09-09 23:42:13 +00:00
|
|
|
if test $GITHUB_REF_NAME == "ci" ; then
|
|
|
|
CI_REF_NAME=${{ inputs.ref_name }}
|
|
|
|
else
|
|
|
|
CI_REF_NAME=$GITHUB_REF_NAME
|
|
|
|
fi
|
|
|
|
echo "building tarball for $CI_REF_NAME"
|
|
|
|
git-archive-all --force-submodules $CI_PROJECT_NAME-$CI_REF_NAME.tar.gz
|
2024-08-12 05:25:33 +00:00
|
|
|
echo "Generating sha512sum"
|
2024-09-09 23:42:13 +00:00
|
|
|
sha512sum $CI_PROJECT_NAME-$CI_REF_NAME.tar.gz > $CI_PROJECT_NAME-$CI_REF_NAME.tar.gz.sha512sum
|
2024-08-12 05:25:33 +00:00
|
|
|
- name: Package upload
|
|
|
|
uses: forgejo/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: tarball
|
2024-09-09 23:42:13 +00:00
|
|
|
path: zotero-*.tar*
|
2024-08-12 05:32:43 +00:00
|
|
|
upload-tarball:
|
2024-08-12 05:38:57 +00:00
|
|
|
name: Upload to generic repo
|
2024-08-12 04:07:17 +00:00
|
|
|
runs-on: x86_64
|
2024-08-12 05:25:33 +00:00
|
|
|
needs: [build-tarball]
|
2024-08-12 04:07:17 +00:00
|
|
|
container:
|
2024-08-12 05:39:42 +00:00
|
|
|
image: alpine:latest
|
2024-08-12 04:07:17 +00:00
|
|
|
steps:
|
2024-08-12 05:32:43 +00:00
|
|
|
- name: Environment setup
|
2024-08-12 05:46:36 +00:00
|
|
|
run: apk add nodejs curl
|
2024-08-12 05:32:43 +00:00
|
|
|
- name: Package download
|
|
|
|
uses: forgejo/download-artifact@v3
|
|
|
|
- name: Package deployment
|
|
|
|
run: |
|
2024-09-10 00:04:02 +00:00
|
|
|
if test $GITHUB_REF_NAME == "ci" ; then
|
|
|
|
CI_REF_NAME=${{ inputs.ref_name }}
|
|
|
|
else
|
|
|
|
CI_REF_NAME=$GITHUB_REF_NAME
|
|
|
|
fi
|
2024-09-09 23:42:13 +00:00
|
|
|
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file ./tarball/zotero-*.tar.gz ${{ github.server_url }}/api/packages/mirrors/generic/zotero/$CI_REF_NAME/zotero-$CI_REF_NAME.tar.gz
|
|
|
|
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file ./tarball/zotero-*.tar.gz.sha512sum ${{ github.server_url }}/api/packages/mirrors/generic/zotero/$CI_REF_NAME/zotero-$CI_REF_NAME.tar.gz.sha512sum
|