Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgencheg committed Sep 3, 2024
1 parent 679be41 commit 423d7bb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 31 deletions.
51 changes: 24 additions & 27 deletions .github/workflows/publish-lostparadise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
8 changes: 4 additions & 4 deletions Tools/publish_github_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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...")
Expand All @@ -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)
Expand Down

0 comments on commit 423d7bb

Please sign in to comment.