name: Actions on: push: branches: - 'master' jobs: Build Documentation: 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_SITE_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 and Upload Export Files: runs-on: docker container: catthehacker/ubuntu:act-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Copy export files run: | mkdir -vp /export/atlauncher/.minecraft 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 mkdir -vp /export/prism/.minecraft cp -vrT ./build/prism /export/prism cp -v ./unsup.ini /export/prism/.minecraft/ - 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/ 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=$(echo "${{ steps.extract_commit_message.outputs.message }}") OUTPUT=$(python .gitea/workflows/scripts/message.py "$COMMIT_MESSAGE") if [ "$OUTPUT" = "Usage: python message.py " ]; 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