mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-22 10:55:15 -04:00
Use GitHub actions
This commit is contained in:
parent
9299b95250
commit
1bf9d9e2e2
5 changed files with 100 additions and 79 deletions
64
.github/workflows/CD.yml
vendored
Normal file
64
.github/workflows/CD.yml
vendored
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
name: CD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Install .NET Core
|
||||||
|
uses: actions/setup-dotnet@v1
|
||||||
|
with:
|
||||||
|
dotnet-version: 3.0.100
|
||||||
|
|
||||||
|
- name: Build & publish (CLI)
|
||||||
|
run: dotnet publish DiscordChatExporter.Cli/ -o DiscordChatExporter.Cli/bin/Publish/ --configuration Release
|
||||||
|
|
||||||
|
- name: Build & publish (GUI)
|
||||||
|
run: dotnet publish DiscordChatExporter.Gui/ -o DiscordChatExporter.Gui/bin/Publish/ --configuration Release
|
||||||
|
|
||||||
|
- name: Pack (CLI)
|
||||||
|
run: Compress-Archive -Path DiscordChatExporter.Cli/bin/Publish/* -DestinationPath DiscordChatExporter.Cli/bin/Publish/Archive.zip -Force
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Pack (GUI)
|
||||||
|
run: Compress-Archive -Path DiscordChatExporter.Gui/bin/Publish/* -DestinationPath DiscordChatExporter.Gui/bin/Publish/Archive.zip -Force
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Create release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1.0.0
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: ${{ github.ref }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
- name: Upload release asset (CLI)
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: DiscordChatExporter.Cli/bin/Publish/Archive.zip
|
||||||
|
asset_name: DiscordChatExporter.CLI.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Upload release asset (GUI)
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: DiscordChatExporter.Gui/bin/Publish/Archive.zip
|
||||||
|
asset_name: DiscordChatExporter.zip
|
||||||
|
asset_content_type: application/zip
|
34
.github/workflows/CI.yml
vendored
Normal file
34
.github/workflows/CI.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Install .NET Core
|
||||||
|
uses: actions/setup-dotnet@v1
|
||||||
|
with:
|
||||||
|
dotnet-version: 3.0.100
|
||||||
|
|
||||||
|
- name: Build & publish (CLI)
|
||||||
|
run: dotnet publish DiscordChatExporter.Cli/ -o DiscordChatExporter.Cli/bin/Publish/ --configuration Release
|
||||||
|
|
||||||
|
- name: Build & publish (GUI)
|
||||||
|
run: dotnet publish DiscordChatExporter.Gui/ -o DiscordChatExporter.Gui/bin/Publish/ --configuration Release
|
||||||
|
|
||||||
|
- name: Upload build artifacts (CLI)
|
||||||
|
uses: actions/upload-artifact@master
|
||||||
|
with:
|
||||||
|
name: DiscordChatExporter.CLI
|
||||||
|
path: DiscordChatExporter.Cli/bin/Publish/
|
||||||
|
|
||||||
|
- name: Upload build artifact (GUI)
|
||||||
|
uses: actions/upload-artifact@master
|
||||||
|
with:
|
||||||
|
name: DiscordChatExporter
|
||||||
|
path: DiscordChatExporter.Gui/bin/Publish/
|
|
@ -1,48 +0,0 @@
|
||||||
# -- GUI --
|
|
||||||
|
|
||||||
$licenseFilePath = "$PSScriptRoot/../License.txt"
|
|
||||||
|
|
||||||
$projectDirPath = "$PSScriptRoot/../DiscordChatExporter.Gui"
|
|
||||||
$publishDirPath = "$PSScriptRoot/bin/build/"
|
|
||||||
$artifactFilePath = "$PSScriptRoot/bin/DiscordChatExporter.zip"
|
|
||||||
|
|
||||||
# Prepare directory
|
|
||||||
if (Test-Path $publishDirPath) {
|
|
||||||
Remove-Item $publishDirPath -Recurse -Force
|
|
||||||
}
|
|
||||||
New-Item $publishDirPath -ItemType Directory -Force
|
|
||||||
|
|
||||||
# Build & publish
|
|
||||||
dotnet publish $projectDirPath -o $publishDirPath -c Release | Out-Host
|
|
||||||
|
|
||||||
$files = @()
|
|
||||||
$files += Get-Item -Path $licenseFilePath
|
|
||||||
$files += Get-ChildItem -Path $publishDirPath
|
|
||||||
|
|
||||||
# Pack into archive
|
|
||||||
$files | Compress-Archive -DestinationPath $artifactFilePath -Force
|
|
||||||
|
|
||||||
|
|
||||||
# -- CLI --
|
|
||||||
|
|
||||||
$licenseFilePath = "$PSScriptRoot/../License.txt"
|
|
||||||
|
|
||||||
$projectDirPath = "$PSScriptRoot/../DiscordChatExporter.Cli"
|
|
||||||
$publishDirPath = "$PSScriptRoot/bin/build/"
|
|
||||||
$artifactFilePath = "$PSScriptRoot/bin/DiscordChatExporter.Cli.zip"
|
|
||||||
|
|
||||||
# Prepare directory
|
|
||||||
if (Test-Path $publishDirPath) {
|
|
||||||
Remove-Item $publishDirPath -Recurse -Force
|
|
||||||
}
|
|
||||||
New-Item $publishDirPath -ItemType Directory -Force
|
|
||||||
|
|
||||||
# Build & publish
|
|
||||||
dotnet publish $projectDirPath -o $publishDirPath -c Release | Out-Host
|
|
||||||
|
|
||||||
$files = @()
|
|
||||||
$files += Get-Item -Path $licenseFilePath
|
|
||||||
$files += Get-ChildItem -Path $publishDirPath
|
|
||||||
|
|
||||||
# Pack into archive
|
|
||||||
$files | Compress-Archive -DestinationPath $artifactFilePath -Force
|
|
|
@ -1,6 +1,6 @@
|
||||||
# DiscordChatExporter
|
# DiscordChatExporter
|
||||||
|
|
||||||
[](https://ci.appveyor.com/project/Tyrrrz/DiscordChatExporter)
|
[](https://github.com/Tyrrrz/DiscordChatExporter/actions)
|
||||||
[](https://github.com/Tyrrrz/DiscordChatExporter/releases)
|
[](https://github.com/Tyrrrz/DiscordChatExporter/releases)
|
||||||
[](https://github.com/Tyrrrz/DiscordChatExporter/releases)
|
[](https://github.com/Tyrrrz/DiscordChatExporter/releases)
|
||||||
[](https://patreon.com/tyrrrz)
|
[](https://patreon.com/tyrrrz)
|
||||||
|
@ -12,7 +12,7 @@ DiscordChatExporter can be used to export message history from a [Discord](https
|
||||||
|
|
||||||
- **[Latest release](https://github.com/Tyrrrz/DiscordChatExporter/releases/latest)**
|
- **[Latest release](https://github.com/Tyrrrz/DiscordChatExporter/releases/latest)**
|
||||||
- [Docker image](https://hub.docker.com/r/tyrrrz/discordchatexporter): `docker pull tyrrrz/discordchatexporter`
|
- [Docker image](https://hub.docker.com/r/tyrrrz/discordchatexporter): `docker pull tyrrrz/discordchatexporter`
|
||||||
- [CI build](https://ci.appveyor.com/project/Tyrrrz/DiscordChatExporter/branch/master/artifacts)
|
- [CI build](https://github.com/Tyrrrz/DiscordChatExporter/actions)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
29
appveyor.yml
29
appveyor.yml
|
@ -1,29 +0,0 @@
|
||||||
version: '{build}'
|
|
||||||
|
|
||||||
image: Visual Studio 2019
|
|
||||||
configuration: Release
|
|
||||||
|
|
||||||
before_build:
|
|
||||||
- ps: nuget restore
|
|
||||||
|
|
||||||
build:
|
|
||||||
verbosity: minimal
|
|
||||||
|
|
||||||
after_build:
|
|
||||||
- ps: Deploy/Prepare.ps1
|
|
||||||
|
|
||||||
artifacts:
|
|
||||||
- path: Deploy/bin/DiscordChatExporter.zip
|
|
||||||
name: DiscordChatExporter.zip
|
|
||||||
- path: Deploy/bin/DiscordChatExporter.CLI.zip
|
|
||||||
name: DiscordChatExporter.CLI.zip
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
- provider: GitHub
|
|
||||||
auth_token:
|
|
||||||
secure: sjQHWRw29AMiVMn3MtidtWnAzAf1mJ+mkJ/7h1B9TIAHhkFrqwMK7LtXV+uNJ9AO
|
|
||||||
artifact: DiscordChatExporter.zip,DiscordChatExporter.CLI.zip
|
|
||||||
description: '[Changelog](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/Changelog.md)'
|
|
||||||
on:
|
|
||||||
branch: master
|
|
||||||
appveyor_repo_tag: true
|
|
Loading…
Add table
Add a link
Reference in a new issue