mirror of
https://github.com/minoplhy/deployment.git
synced 2025-04-21 18:46:57 +00:00
47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
name: forgejo Mega Build
|
|
run-name: forgejo Build
|
|
on:
|
|
push:
|
|
tags:
|
|
- forgejo-*
|
|
jobs:
|
|
build_forgejo:
|
|
runs-on: [ubuntu-latest]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up environment variables
|
|
run: |
|
|
TAG_NAME=${GITHUB_REF##*/}
|
|
GITEA_TAG=${TAG_NAME#forgejo-}
|
|
|
|
echo "GITEA_TAG=${GITEA_TAG}" >> $GITHUB_ENV
|
|
echo "GITEA_TAG=${GITEA_TAG}"
|
|
|
|
- name: Setup Package Directory
|
|
run: |
|
|
sudo mkdir -p /forgejo-${GITEA_TAG}
|
|
|
|
- name: Run forgejo Build (binary + static)
|
|
run: |
|
|
echo "This Task will be run using the following tag: ${GITEA_TAG}"
|
|
curl -L https://github.com/minoplhy/scriptbox/raw/main/build_gitea/Linux/build.sh | bash -s -- --git-tag "${GITEA_TAG}" --static --type=forgejo
|
|
|
|
# Copy forgejo to package directory(this is due to a broken mechanism in origin script)
|
|
sudo cp ~/gitea-binaries/gitea /forgejo-${GITEA_TAG}/gitea
|
|
sudo cp -r ~/gitea-binaries/gitea-static /forgejo-${GITEA_TAG}/gitea-static
|
|
|
|
- name: Zip Package
|
|
run: |
|
|
sudo tar czvf forgejo-${GITEA_TAG}.tar.gz /forgejo-${GITEA_TAG}
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
body: |
|
|
"forgejo Successfully build on -> ${{ env.GITEA_TAG }}"
|
|
token: ${{ secrets.DEPLOYMENT_TOKEN }}
|
|
files: forgejo-*.tar.gz
|