This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
GalacticFactory-Legacy/.gitea/workflows/actions.yaml
cswimr f797173517
All checks were successful
Actions / build_export_files (push) Successful in 9s
Actions / autotagger (push) Successful in 12s
Actions / build_docs (push) Successful in 22s
fixed an issue with the documentation build step
2024-09-22 14:17:15 -04:00

153 lines
5.4 KiB
YAML

name: Actions
on:
push:
branches:
- 'master'
jobs:
build_docs:
runs-on: docker
container: www.coastalcommits.com/galacticfactory/documentation:latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: poetry install --no-root
- name: Set environment variables
uses: actions/env@v2
- name: Build documentation
run: |
export SITE_URL="https://$CI_ACTION_REF_NAME_SLUG.docs.galacticfactory.cc"
export EDIT_URI="src/branch/$CI_ACTION_REF_NAME/docs"
mkdocs build -v
- name: Deploy documentation
run: |
GREEN="\\033[0;32m"
YELLOW="\\033[0;33m"
BLUE="\\033[0;34m"
unset GITHUB_TOKEN
unset GITLAB_TOKEN
echo "${YELLOW}Deploying to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}...\n"
npx -p "@getmeli/cli" meli upload ./site --url "https://pages.coastalcommits.com" --site "${{ vars.MELI_SITE_ID }}" --token "${{ secrets.MELI_SECRET }}" --release "$CI_ACTION_REF_NAME_SLUG/${{ env.GITHUB_SHA }}" --branch "$CI_ACTION_REF_NAME_SLUG"
echo "\n${YELLOW}Deployed to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}!"
echo "${GREEN}https://$CI_ACTION_REF_NAME_SLUG.docs.galacticfactory.cc/"
env:
GITEA_TOKEN: ${{ secrets.COASTALCOMMITSTOKEN }}
build_export_files:
runs-on: docker
container: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Copy export files
run: |
# ATLauncher
mkdir -vp /export/atlauncher/.minecraft/meta
cp -vrT ./build/atlauncher /export/atlauncher
cp -vp ./unsup.ini /export/atlauncher/.minecraft/
wget -O /export/atlauncher/.minecraft/galacticfactory-updater.jar https://git.sleeping.town/attachments/7edb17a2-e43f-4789-8bae-6140cbe98311
cp -vp ./LICENSE /export/atlauncher/.minecraft/meta/
cp -vp ./PERMISSIONS.md /export/atlauncher/.minecraft/meta/
# Prism Launcher
mkdir -vp /export/prism/.minecraft/meta
cp -vrT ./build/prism /export/prism
cp -v ./unsup.ini /export/prism/.minecraft/
cp -v ./LICENSE /export/prism/.minecraft/meta/
cp -v ./PERMISSIONS.md /export/prism/.minecraft/meta/
# Modrinth
mkdir -vp /export/modrinth/.minecraft/overrides/meta
cp -v ./build/modrinth.index.json /export/modrinth/
cp -v /export/atlauncher/.minecraft/galacticfactory-updater.jar /export/modrinth/.minecraft/overrides/
cp -v ./unsup.ini /export/modrinth/.minecraft/overrides/
cp -v ./LICENSE /export/modrinth/.minecraft/overrides/meta/
cp -v ./PERMISSIONS.md /export/modrinth/.minecraft/overrides/meta/
- name: Upload ATLauncher export artifact
uses: actions/upload-artifact@v3
with:
name: ATLauncher
path: /export/atlauncher/
continue-on-error: true
- name: Upload Prism Launcher export artifact
uses: actions/upload-artifact@v3
with:
name: PrismLauncher
path: /export/prism/
continue-on-error: true
- name: Upload Modrinth export artifact
uses: actions/upload-artifact@v3
with:
name: Modrinth
path: /export/modrinth/
continue-on-error: true
autotagger:
runs-on: docker
container: catthehacker/ubuntu:act-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Git
run: |
git config --global user.name "GalacticFactory"
git config --global user.email "contact@galacticfactory.cc"
- name: Import GPG key
uses: actions/gpg@v4
with:
gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
passphrase : ${{ secrets.GPG_PASSPHRASE }}
- name: Extract commit message
id: extract_commit_message
run: echo "::set-output name=message::$(git log --format=%B -n 1 $GITHUB_SHA)"
- name: Check commit message
id: check_commit_message
run: |
COMMIT_MESSAGE="${{ steps.extract_commit_message.outputs.message }}"
OUTPUT="$(python .gitea/workflows/scripts/message.py "$COMMIT_MESSAGE")"
if [ "$OUTPUT" = "Usage: python message.py <commit_message>" ]; then
echo "Called without commit message!"
exit 1
elif [ "$OUTPUT" = "None" ]; then
echo "No version bump."
echo "::set-output name=latest_tag::$(git describe --tags --abbrev=0)"
else
echo "Version bump detected: $OUTPUT"
echo "::set-output name=version::$OUTPUT"
fi
- name: Create tag
if: steps.check_commit_message.outputs.version
run: |
VERSION=${{ steps.check_commit_message.outputs.version }}
git tag -s $VERSION -m "version bumped to $VERSION"
git push origin $VERSION
- name: Update latest tag
if: steps.check_commit_message.outputs.latest_tag
run: |
COMMIT_MESSAGE="$(echo "${{ steps.extract_commit_message.outputs.message }}")"
LATEST_TAG="${{ steps.check_commit_message.outputs.latest_tag }}"
git tag -fs $LATEST_TAG -m "$COMMIT_MESSAGE"
git push origin $LATEST_TAG --force