This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
revert question mark launch options #46
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache conda | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/conda_pkgs_dir | |
key: ${{ runner.os }}-conda-${{ hashFiles('**/environment.yml') }} | |
restore-keys: | | |
${{ runner.os }}-conda- | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
python-version: "3.11.3" | |
environment-file: environment.yml | |
activate-environment: ark | |
auto-activate-base: false | |
- name: Configure conda package dir | |
run: conda config --add pkgs_dirs ~/conda_pkgs_dir | |
- name: Generate Passphrase | |
shell: bash -l {0} | |
run: echo "PASSPHRASE=$(openssl rand -base64 32)" >> $GITHUB_ENV | |
- name: Encryption | |
env: | |
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} | |
PASSPHRASE: ${{ env.PASSPHRASE }} | |
shell: bash -l {0} | |
run: | | |
python src/crypto_script.py --mode encrypt --input "$CURSEFORGE_API_KEY" --output encrypted_key.enc --passphrase "$PASSPHRASE" | |
echo "$PASSPHRASE" > passphrase.txt | |
- name: Install PyInstaller | |
shell: bash -l {0} | |
run: | | |
conda install -c conda-forge pyinstaller || pip install pyinstaller | |
- name: Build Executable | |
shell: bash -l {0} | |
run: | | |
cd src | |
rm -f __init__.py | |
pyinstaller --onefile --name=arkserversuite --add-data "ps;ps" --add-data "../encrypted_key.enc;." --add-data "../passphrase.txt;." main.py | |
cd .. | |
mkdir -p dist | |
mv src/dist/arkserversuite.exe dist/arkserversuite.exe | |
- name: Zip Executable and Config Directory | |
shell: bash -l {0} | |
run: | | |
7z a release.zip ./dist/arkserversuite.exe ./config/ | |
- name: Upload release artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: release | |
path: release.zip | |
changelog: | |
needs: build | |
runs-on: ubuntu-20.04 | |
outputs: | |
changelog: ${{ steps.changelog_output.outputs.changelog }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Generate release changelog | |
id: changelog_output | |
uses: heinrichreimer/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
create_release: | |
needs: [build, changelog] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: ${{ needs.changelog.outputs.changelog }} | |
draft: false | |
prerelease: false | |
- name: Download release artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: release | |
path: . | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./release.zip | |
asset_name: release.zip | |
asset_content_type: application/zip |