Skip to content

v2.1.1 for KSP 1.12.x #7

v2.1.1 for KSP 1.12.x

v2.1.1 for KSP 1.12.x #7

# This is a basic workflow to help you get started with Actions
name: "Attach Release Artifacts"
# Controls when the workflow will run
on:
release:
types: [published]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
attach-release-artifacts:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Setup Python
uses: actions/setup-python@v2
- name: Make metadata
run: |
python ${GITHUB_WORKSPACE}/makeMeta.py ${{ github.event.release.tag_name }}
- name: Assemble release
id: assemble-release
run: |
RELEASE_DIR="${RUNNER_TEMP}/release"
echo "Release dir: ${RELEASE_DIR}"
echo "Release zip: ${RELEASE_DIR}/ROSolar-${{ github.event.release.tag_name }}.zip"
mkdir -v "${RELEASE_DIR}"
echo "::set-output name=release-dir::${RELEASE_DIR}"
cp -v -R "${GITHUB_WORKSPACE}/GameData/ROSolar" "${RELEASE_DIR}"
cp -v -R "${GITHUB_WORKSPACE}/ROSolar.version" "${RELEASE_DIR}/ROSolar/ROSolar.version"
cd ${RELEASE_DIR}
zip -r ROSolar-${{ github.event.release.tag_name }}.zip ROSolar
ls -lrt -d -1 "${RELEASE_DIR}"/{*,.*}
- name: Upload package to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.assemble-release.outputs.release-dir }}/ROSolar-${{ github.event.release.tag_name }}.zip
asset_name: ROSolar-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip