From a4acda1fcfa5bc735fdbd94fa215b9bb96c3b040 Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 1 Jul 2023 04:24:20 +0900 Subject: [PATCH 1/2] add github actions autobuild added build automation for every push need to fix maybe file versioning can also be manually built --- .github/workflows/build.yml | 70 +++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b2a5ae8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,70 @@ +name: Build MCLauncher +on: + #schedule: + # - cron: "30 2 1 * *" + push: + branches: [buildtest] + 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/setup-msbuild@v1.1 + + - 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 + From f8cdcc40301a6d262fd3babf1ecf54adc9a6d16f Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 1 Jul 2023 04:25:17 +0900 Subject: [PATCH 2/2] fix branch to build branches: [master] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2a5ae8..1437cf0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ on: #schedule: # - cron: "30 2 1 * *" push: - branches: [buildtest] + branches: [master] workflow_dispatch: repository_dispatch: types: [build]