ci: update refresh secrets #208
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: semantic_release | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
deploy: | |
if: github.repository == 'alandtse/skyrim_vr_address_library' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get VR Address Tools | |
run: git clone https://github.com/alandtse/vr_address_tools.git . | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: "skyrim_vr_address_library" | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
#---------------------------------------------- | |
# install your root project, if required | |
#---------------------------------------------- | |
- name: Install library | |
run: poetry install --no-interaction | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 14 | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v4 | |
id: semantic # Need an `id` for output variables | |
with: | |
# You can specify specifying version range for the extra plugins if you prefer. | |
extra_plugins: | | |
@semantic-release/changelog | |
@semantic-release/git | |
@semantic-release/github | |
working_directory: ./skyrim_vr_address_library | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate release csv | |
if: steps.semantic.outputs.new_release_published == 'true' | |
run: | | |
mkdir -p release/SKSE/Plugins | |
poetry run ./vr_address_tools.py release/SKSE/Plugins/ generate -rv ${{ steps.semantic.outputs.new_release_version }} | |
- name: Create .7z | |
if: steps.semantic.outputs.new_release_published == 'true' | |
uses: edgarrc/action-7z@v1 | |
with: | |
args: 7z a -t7z -mx=9 vr_addresslib-${{ steps.semantic.outputs.new_release_version }}.7z ./release/SKSE | |
- name: Sleep | |
# add delay so upload does not kill the release notes from semantic-release | |
if: steps.semantic.outputs.new_release_published == 'true' | |
run: | | |
sleep 5 | |
- name: Upload zip to release | |
if: steps.semantic.outputs.new_release_published == 'true' | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: vr_addresslib-${{ steps.semantic.outputs.new_release_version }}.7z | |
asset_name: vr_addresslib-${{ steps.semantic.outputs.new_release_version }}.7z | |
tag: ${{ steps.semantic.outputs.new_release_git_tag }} | |
overwrite: true | |
- name: Setup Dotnet | |
if: steps.semantic.outputs.new_release_published == 'true' | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.x.x | |
- name: Download NexusUploader | |
if: steps.semantic.outputs.new_release_published == 'true' | |
run: dotnet tool install -g BUTR.NexusUploader | |
- name: Upload files to Nexus | |
# https://github.com/agc93/nexus-uploader using fork https://github.com/BUTR/BUTR.NexusUploader | |
if: steps.semantic.outputs.new_release_published == 'true' | |
env: | |
UNEX_SESSION_COOKIE: ${{ secrets.UNEX_NEXUSMODS_SESSION_COOKIE }} | |
UNEX_APIKEY: ${{ secrets.UNEX_APIKEY }} | |
UNEX_FILEDESCRIPTION: https://github.com/alandtse/skyrim_vr_address_library/compare/${{ steps.semantic.outputs.last_release_git_tag }}...${{ steps.semantic.outputs.new_release_git_tag }} | |
UNEX_MODID: 58101 | |
UNEX_GAME: skyrimspecialedition | |
UNEX_FILENAME: VR Address Library | |
UNEX_PREVIOUSFILE: "auto" | |
file: vr_addresslib-${{ steps.semantic.outputs.new_release_version }}.7z | |
version: ${{ steps.semantic.outputs.new_release_version }} | |
changelog: ${{ steps.semantic.outputs.new_release_notes }} | |
run: | | |
unex upload $UNEX_MODID $file -v $version | |
unex changelog $version -c "$changelog" |