cmder/.github/workflows/build.yml

113 lines
2.8 KiB
YAML
Raw Normal View History

2022-10-15 01:45:46 +08:00
#---------------------------------#
# general configuration #
#---------------------------------#
name: Build Cmder
# Controls when the action will run. Triggers the workflow on push or pull request events but only for the main branch
on:
push:
branches: [ "master" ]
tags:
- "v*"
2022-10-15 01:45:46 +08:00
pull_request:
2024-01-03 01:04:31 +08:00
branches: [ "master", "development" ]
2022-10-15 01:45:46 +08:00
#---------------------------------#
# environment configuration #
#---------------------------------#
env:
# Path to the root of the Cmder project.
CMDER_ROOT: ${{ github.workspace }}
2022-10-15 01:45:46 +08:00
permissions:
contents: read
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
2022-10-15 01:55:15 +08:00
name: Build Project
2022-10-15 01:45:46 +08:00
runs-on: windows-latest
2023-07-24 22:04:16 +08:00
permissions:
contents: write
discussions: write
2022-10-15 01:45:46 +08:00
steps:
- name: Check out repository code (Action from GitHub)
uses: actions/checkout@v4
2022-10-15 09:01:56 +08:00
with:
fetch-depth: 0
2022-10-15 01:45:46 +08:00
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
2022-10-15 01:45:46 +08:00
- name: Build Cmder Launcher
shell: pwsh
working-directory: scripts
2023-11-23 20:10:59 +08:00
run: .\build.ps1 -Compile -verbose -terminal all
2022-10-15 01:45:46 +08:00
2023-09-26 04:12:52 +08:00
- name: Pack the built files
2022-10-15 01:45:46 +08:00
shell: pwsh
working-directory: scripts
2023-11-23 20:10:59 +08:00
run: .\pack.ps1 -verbose -terminal all
2023-09-26 03:59:10 +08:00
- name: Upload artifact (cmder_wt.zip)
uses: actions/upload-artifact@v3
with:
path: build/cmder_wt.zip
name: cmder_wt.zip
if-no-files-found: error
- name: Upload artifact (cmder_wt.7z)
uses: actions/upload-artifact@v3
with:
path: build/cmder_wt.7z
name: cmder_wt.7z
- name: Upload artifact (cmder_wt_mini.zip)
uses: actions/upload-artifact@v3
with:
path: build/cmder_wt_mini.zip
name: cmder_wt_mini.zip
2022-10-15 01:45:46 +08:00
2022-10-15 07:00:45 +08:00
- name: Upload artifact (cmder.zip)
uses: actions/upload-artifact@v4
2022-10-15 01:45:46 +08:00
with:
2022-10-15 07:00:45 +08:00
path: build/cmder.zip
name: cmder.zip
2022-10-15 01:45:46 +08:00
if-no-files-found: error
2022-10-15 07:00:45 +08:00
- name: Upload artifact (cmder.7z)
uses: actions/upload-artifact@v4
2022-10-15 07:00:45 +08:00
with:
path: build/cmder.7z
name: cmder.7z
- name: Upload artifact (cmder_mini.zip)
uses: actions/upload-artifact@v4
2022-10-15 07:00:45 +08:00
with:
path: build/cmder_mini.zip
name: cmder_mini.zip
- name: Upload artifact (hashes.txt)
uses: actions/upload-artifact@v4
2022-10-15 07:00:45 +08:00
with:
path: build/hashes.txt
name: hashes.txt
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
build/cmder.zip
2023-09-26 03:59:10 +08:00
build/cmder_wt.zip
build/cmder.7z
2023-09-26 03:59:10 +08:00
build/cmder_wt.7z
build/cmder_mini.zip
2023-09-26 03:59:10 +08:00
build/cmder_wt_mini.zip
build/hashes.txt
draft: true
generate_release_notes: true
if: startsWith(github.ref, 'refs/tags/')