2024-06-11 20:53:23 +00:00
|
|
|
name: Actions
|
|
|
|
on:
|
|
|
|
push:
|
2024-10-21 16:58:05 -04:00
|
|
|
pull_request:
|
2024-10-20 20:13:56 -04:00
|
|
|
workflow_dispatch:
|
2024-06-11 20:53:23 +00:00
|
|
|
|
|
|
|
jobs:
|
2024-10-21 16:58:05 -04:00
|
|
|
docs:
|
2024-09-22 14:22:18 -04:00
|
|
|
name: Build Documentation
|
2024-10-21 16:58:05 -04:00
|
|
|
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
|
2024-06-11 20:53:23 +00:00
|
|
|
runs-on: docker
|
2025-02-13 10:41:42 -06:00
|
|
|
container: c.csw.im/cswimr/actions:docs
|
2024-06-11 20:53:23 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Install dependencies
|
2024-10-21 13:53:40 -04:00
|
|
|
run: uv sync
|
2024-06-11 20:53:23 +00:00
|
|
|
|
|
|
|
- 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"
|
2024-10-21 13:53:40 -04:00
|
|
|
uv run mkdocs build -v
|
2024-06-11 20:53:23 +00:00
|
|
|
|
|
|
|
- name: Deploy documentation
|
|
|
|
run: |
|
2024-09-22 14:11:04 -04:00
|
|
|
GREEN="\\033[0;32m"
|
|
|
|
YELLOW="\\033[0;33m"
|
|
|
|
BLUE="\\033[0;34m"
|
2024-06-11 20:53:23 +00:00
|
|
|
|
|
|
|
unset GITHUB_TOKEN
|
|
|
|
unset GITLAB_TOKEN
|
|
|
|
|
|
|
|
echo "${YELLOW}Deploying to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}...\n"
|
|
|
|
|
2025-02-13 10:41:42 -06:00
|
|
|
npx -p "@getmeli/cli" meli upload ./site --url "https://meli.csw.im" --site "${{ vars.MELI_SITE_ID }}" --token "${{ secrets.MELI_TOKEN }}" --release "$CI_ACTION_REF_NAME_SLUG/${{ env.GITHUB_SHA }}" --branch "$CI_ACTION_REF_NAME_SLUG"
|
2024-06-11 20:53:23 +00:00
|
|
|
|
|
|
|
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 }}
|
|
|
|
|
2024-10-21 16:58:05 -04:00
|
|
|
export:
|
2024-09-22 14:22:18 -04:00
|
|
|
name: Build Export Files
|
2024-06-11 20:53:23 +00:00
|
|
|
runs-on: docker
|
|
|
|
container: catthehacker/ubuntu:act-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Copy export files
|
|
|
|
run: |
|
2024-07-10 07:17:37 -04:00
|
|
|
# ATLauncher
|
2024-07-19 09:11:27 -04:00
|
|
|
mkdir -vp /export/atlauncher/.minecraft/meta
|
2024-06-11 20:53:23 +00:00
|
|
|
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
|
2024-07-19 09:11:27 -04:00
|
|
|
cp -vp ./LICENSE /export/atlauncher/.minecraft/meta/
|
|
|
|
cp -vp ./PERMISSIONS.md /export/atlauncher/.minecraft/meta/
|
2024-06-11 20:53:23 +00:00
|
|
|
|
2024-07-10 07:17:37 -04:00
|
|
|
# Prism Launcher
|
2024-10-20 20:13:56 -04:00
|
|
|
mkdir -vp /export/prism/minecraft/meta
|
2024-06-11 20:53:23 +00:00
|
|
|
cp -vrT ./build/prism /export/prism
|
2024-10-20 20:10:51 -04:00
|
|
|
cp -v ./unsup.ini /export/prism/minecraft/
|
|
|
|
cp -v ./LICENSE /export/prism/minecraft/meta/
|
|
|
|
cp -v ./PERMISSIONS.md /export/prism/minecraft/meta/
|
2024-06-11 20:53:23 +00:00
|
|
|
|
2024-07-10 07:17:37 -04:00
|
|
|
# Modrinth
|
2024-07-19 09:11:27 -04:00
|
|
|
mkdir -vp /export/modrinth/.minecraft/overrides/meta
|
2024-07-10 07:13:42 -04:00
|
|
|
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/
|
2024-07-19 09:11:27 -04:00
|
|
|
cp -v ./LICENSE /export/modrinth/.minecraft/overrides/meta/
|
|
|
|
cp -v ./PERMISSIONS.md /export/modrinth/.minecraft/overrides/meta/
|
2024-06-11 20:53:23 +00:00
|
|
|
|
|
|
|
- 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/
|
2024-07-10 07:14:42 -04:00
|
|
|
continue-on-error: true
|
|
|
|
|
|
|
|
- name: Upload Modrinth export artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: Modrinth
|
|
|
|
path: /export/modrinth/
|
|
|
|
continue-on-error: true
|
2024-06-11 20:53:23 +00:00
|
|
|
|
2024-09-22 11:12:33 -04:00
|
|
|
autotagger:
|
2024-09-22 14:22:18 -04:00
|
|
|
name: Autotagger
|
2024-10-21 16:58:05 -04:00
|
|
|
if: github.event_name == 'push' && github.ref_name == 'master'
|
2024-06-11 20:53:23 +00:00
|
|
|
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:
|
2025-02-13 10:41:42 -06:00
|
|
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
|
|
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
2024-06-11 20:53:23 +00:00
|
|
|
|
|
|
|
- name: Extract commit message
|
|
|
|
id: extract_commit_message
|
2024-10-21 14:26:12 -04:00
|
|
|
shell: bash # `@Q` is bash exclusive
|
2024-10-21 14:23:36 -04:00
|
|
|
run: |
|
|
|
|
COMMIT_MESSAGE=$(git log --format=%B -n 1 $GITHUB_SHA)
|
|
|
|
ESCAPED_COMMIT_MESSAGE="${COMMIT_MESSAGE@Q}"
|
2024-10-21 14:28:14 -04:00
|
|
|
echo "Commit message: $ESCAPED_COMMIT_MESSAGE"
|
2024-10-21 14:23:36 -04:00
|
|
|
echo "message=$ESCAPED_COMMIT_MESSAGE" >> $GITHUB_OUTPUT
|
2024-06-11 20:53:23 +00:00
|
|
|
|
|
|
|
- name: Check commit message
|
|
|
|
id: check_commit_message
|
|
|
|
run: |
|
2024-09-22 14:11:04 -04:00
|
|
|
COMMIT_MESSAGE="${{ steps.extract_commit_message.outputs.message }}"
|
2024-10-21 14:26:12 -04:00
|
|
|
OUTPUT="$(python .forgejo/workflows/scripts/message.py "${COMMIT_MESSAGE}")"
|
2024-06-11 20:53:23 +00:00
|
|
|
if [ "$OUTPUT" = "Usage: python message.py <commit_message>" ]; then
|
|
|
|
echo "Called without commit message!"
|
|
|
|
exit 1
|
|
|
|
elif [ "$OUTPUT" = "None" ]; then
|
|
|
|
echo "No version bump."
|
2024-10-21 14:23:36 -04:00
|
|
|
echo "latest_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
|
2024-06-11 20:53:23 +00:00
|
|
|
else
|
|
|
|
echo "Version bump detected: $OUTPUT"
|
2024-10-21 14:23:36 -04:00
|
|
|
echo "version=$OUTPUT" >> $GITHUB_OUTPUT
|
2024-06-11 20:53:23 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Create tag
|
2024-10-21 14:23:36 -04:00
|
|
|
if: steps.check_commit_message.outputs.version != ''
|
2024-06-11 20:53:23 +00:00
|
|
|
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
|
2024-10-21 14:23:36 -04:00
|
|
|
if: steps.check_commit_message.outputs.latest_tag != ''
|
2024-06-11 20:53:23 +00:00
|
|
|
run: |
|
2024-10-21 14:28:14 -04:00
|
|
|
COMMIT_MESSAGE="${{ steps.extract_commit_message.outputs.message }}"
|
2024-09-22 14:11:04 -04:00
|
|
|
LATEST_TAG="${{ steps.check_commit_message.outputs.latest_tag }}"
|
2024-06-11 20:53:23 +00:00
|
|
|
git tag -fs $LATEST_TAG -m "$COMMIT_MESSAGE"
|
|
|
|
git push origin $LATEST_TAG --force
|