Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoreleasebuilds #264

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build MCLauncher
on:
#schedule:
# - cron: "30 2 1 * *"
push:
branches: [master]
workflow_dispatch:
repository_dispatch:
types: [build]

concurrency:
group: ${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build MCLauncher
runs-on: windows-2019


steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install 7Zip PowerShell Module
shell: powershell
run: Install-Module 7Zip4PowerShell -Force -Verbose

- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Setup NuGet
uses: nuget/setup-nuget@v1

- name: Restore NuGet Packages
run: nuget restore MCLauncher.sln

- name: Build MCLauncher proj
id: MCLauncher
run: msbuild MCLauncher.sln /p:Configuration=Release /p:Platform=x64

- name: Build Artifact
shell: cmd
id: artifacts
run: powershell Compress-7Zip "x64\Release" -ArchiveFileName "MCLauncher.zip" -Format Zip

- name: Prepare release tag
shell: bash
id: date
run: echo "date=$(date +'v%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: add timestamp
shell: bash
id: date2
run: echo "date2=$(date +'v%Y_%m_%d')" >> $GITHUB_OUTPUT

- name: rename files
shell: bash
id: rename
run: cp "./MCLauncher.zip" "./${{ steps.date2.outputs.date2 }}.MCLauncher.zip"

- name: Upload build to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: \${{ steps.date2.outputs.date2 }}.MCLauncher.zip
tag: ${{ steps.date.outputs.date }}
overwrite: true
file_glob: true