Skip to content

0.3.0

0.3.0 #18

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .Net Release
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: |
src
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: publish win-x64
run: dotnet publish src\\GegeBot -p:PublishProfile=src\\GegeBot\\Properties\\PublishProfiles\\win-x64.pubxml
- name: publish osx-x64
run: dotnet publish src\\GegeBot -p:PublishProfile=src\\GegeBot\\Properties\\PublishProfiles\\osx-x64.pubxml
- name: publish linux-x64
run: dotnet publish src\\GegeBot -p:PublishProfile=src\\GegeBot\\Properties\\PublishProfiles\\linux-x64.pubxml
- name: Pack
run: |
7z a ./outputs/gege-bot_v${{ github.event.release.tag_name }}_win-x64.zip ./bin/gege-bot/win-x64/*
7z a ./outputs/gege-bot_v${{ github.event.release.tag_name }}_osx-x64.zip ./bin/gege-bot/osx-x64/*
7z a ./outputs/gege-bot_v${{ github.event.release.tag_name }}_linux-x64.zip ./bin/gege-bot/linux-x64/*
- name: Release
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_PATH: outputs/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Upload release
# id: upload_release
# uses: actions/github-script@v3
# with:
# github-token: ${{secrets.GITHUB_TOKEN}}
# script: |
# const path = require('path');
# const fs = require('fs');
# const release_id = '${{ github.event.release.id }}';
# for (let file of await fs.readdirSync('./outputs')) {
# if (path.extname(file) === '.zip') {
# console.log('uploadReleaseAsset', file);
# await github.repos.uploadReleaseAsset({
# owner: context.repo.owner,
# repo: context.repo.repo,
# release_id: release_id,
# name: file,
# data: await fs.readFileSync(`./outputs/${file}`)
# });
# }
# }