This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
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: Set up API Key | |
run: | | |
echo "API_KEY=${{ secrets.CURSEFORGE_API_KEY }}" >> $GITHUB_ENV | |
- 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: Install Dependencies | |
shell: bash -l {0} | |
run: | | |
conda env update --name ark --file environment.yml | |
- 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 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/action-github-changelog-generator@v2.3 | |
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 |