Skip to content

test workflow

test workflow #14

name: Create GitHub Release
on:
push:
branches:
- master
paths:
- Teleportation/**
jobs:
build:
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version
id: package_version
uses: KageKirin/get-csproj-version@v0
with:
file: ./${{ github.event.repository.name }}/${{ github.event.repository.name }}.csproj
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Install zip
run: sudo apt-get install zip
- name: Zip Rocket release artifacts
env:
BUILD_DIRECTORY: "./${{ github.event.repository.name }}/bin/Release/net48/"
PLUGIN_FILE_NAME: "${{ github.event.repository.name }}.dll"
run: |
mkdir -p ./release-template/Plugins ./release-template/Libraries
mv $BUILD_DIRECTORY/$PLUGIN_FILE_NAME ./release-template/Plugins/
[ -f $BUILD_DIRECTORY/*.dll ] && mv $BUILD_DIRECTORY/*.dll ./release-template/Libraries/
cd ./template/
zip -qr ./../release.zip *
shell: bash
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.package_version.outputs.version }}
release_name: "${{ github.event.repository.name }} v${{ steps.package_version.outputs.version }}"
draft: true
prerelease: false
- name: Upload Rocket 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: "/${{ github.event.repository.name }}-v${{ steps.package_version.outputs.version }}.zip"
asset_content_type: application/zip
- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}