From 423d7bbc2b1db666521b1ef2f1c58bfe4d639846 Mon Sep 17 00:00:00 2001 From: TAZIKLIK <73418250+Evgencheg@users.noreply.github.com> Date: Tue, 3 Sep 2024 23:18:53 +0300 Subject: [PATCH] fixes --- .github/workflows/publish-lostparadise.yml | 51 ++++++++++------------ Tools/publish_github_artifact.py | 8 ++-- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/.github/workflows/publish-lostparadise.yml b/.github/workflows/publish-lostparadise.yml index 512e395ad6..33a093c2fe 100644 --- a/.github/workflows/publish-lostparadise.yml +++ b/.github/workflows/publish-lostparadise.yml @@ -6,12 +6,6 @@ concurrency: on: workflow_dispatch: -env: - BOT_TOKEN: ${{ secrets.BOT_TOKEN }} - CHANGELOG_DIR: Resources/Changelog/ChangelogLPP.yml - PR_NUMBER: ${{ github.event.number }} - CHANGELOG_DISCORD_WEBHOOK: ${{ secrets.CHANGELOG_DISCORD_WEBHOOK }} - jobs: build: runs-on: ubuntu-latest @@ -45,32 +39,35 @@ jobs: run: dotnet build Content.Packaging --configuration Release --no-restore /m - name: Package server - run: dotnet run --project Content.Packaging server --platform linux-x64 --hybrid-acz + run: dotnet run --project Content.Packaging server --platform linux-x64 - - name: Shuffle files around - run: | - mkdir "release/${{ github.sha }}" - mv release/*.zip "release/${{ github.sha }}" + - name: Package client + run: dotnet run --project Content.Packaging client --no-wipe-release - - name: Upload files to centcomm - uses: appleboy/scp-action@master + - name: Upload build artifact + id: artifact-upload-step + uses: actions/upload-artifact@v4 with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.SSH }} - port: ${{ secrets.PORT }} - source: "release/${{ github.sha }}" - target: "/var/www/wiki/builds_dir/builds/" - strip_components: 1 + name: build + path: release/*.zip + compression-level: 0 + retention-days: 0 - - name: Update manifest JSON - uses: appleboy/ssh-action@master + - name: Publish version + run: Tools/publish_github_artifact.py + env: + BOT_TOKEN: ${{ secrets.BOT_TOKEN }} + PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} + ARTIFACT_ID: ${{ steps.artifact-upload-step.outputs.artifact-id }} + GITHUB_REPOSITORY: ${{ vars.GITHUB_REPOSITORY }} + + - uses: geekyeggo/delete-artifact@v5 + if: always() with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.SSH }} - port: ${{ secrets.PORT }} - script: pwsh /var/www/wiki/push.ps1 ${{ github.sha }} + name: build - name: Publish changelog run: Tools/actions_changelogs_since_last_run.py + with: + BOT_TOKEN: ${{ secrets.BOT_TOKEN }} + CHANGELOG_DISCORD_WEBHOOK: ${{ secrets.CHANGELOG_DISCORD_WEBHOOK }} diff --git a/Tools/publish_github_artifact.py b/Tools/publish_github_artifact.py index b488ccdf2e..7a05fa124a 100755 --- a/Tools/publish_github_artifact.py +++ b/Tools/publish_github_artifact.py @@ -4,7 +4,7 @@ import os import subprocess -GITHUB_TOKEN = os.environ["GITHUB_TOKEN"] +BOT_TOKEN = os.environ["BOT_TOKEN"] PUBLISH_TOKEN = os.environ["PUBLISH_TOKEN"] ARTIFACT_ID = os.environ["ARTIFACT_ID"] GITHUB_REPOSITORY = os.environ["GITHUB_REPOSITORY"] @@ -14,8 +14,8 @@ # CONFIGURATION PARAMETERS # Forks should change these to publish to their own infrastructure. # -ROBUST_CDN_URL = "https://wizards.cdn.spacestation14.com/" -FORK_ID = "wizards" +ROBUST_CDN_URL = "https://wiki.lost-paradise.space/cdn/" +FORK_ID = "LPP" def main(): print("Fetching artifact URL from API...") @@ -37,7 +37,7 @@ def main(): def get_artifact_url() -> str: headers = { - "Authorization": f"Bearer {GITHUB_TOKEN}", + "Authorization": f"Bearer {BOT_TOKEN}", "X-GitHub-Api-Version": "2022-11-28" } resp = requests.get(f"https://api.github.com/repos/{GITHUB_REPOSITORY}/actions/artifacts/{ARTIFACT_ID}/zip", allow_redirects=False, headers=headers)