Files
netch/.github/workflows/build.yml
dependabot[bot] 563565b3b4 Bump andstor/file-existence-action from 1 to 2 (#980)
Bumps [andstor/file-existence-action](https://github.com/andstor/file-existence-action) from 1 to 2.
- [Release notes](https://github.com/andstor/file-existence-action/releases)
- [Commits](https://github.com/andstor/file-existence-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: andstor/file-existence-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-02 09:09:40 +08:00

88 lines
3.0 KiB
YAML

name: Netch Build CI
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checksum
shell: pwsh
run: |
echo "SOURCE_NETCH_SHA256=$(.\sha256.ps1 .\Netch)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_OTHER_SHA256=$(.\sha256.ps1 .\Other)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_REDIRECTOR_SHA256=$(.\sha256.ps1 .\Redirector)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_ROUTEHELPER_SHA256=$(.\sha256.ps1 .\RouteHelper)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
- name: Cache Netch
uses: actions/cache@v3
with:
key: Netch-${{ runner.os }}-Netch-${{ env.SOURCE_NETCH_SHA256 }}
path: |
.\Netch\bin
- name: Cache Other
uses: actions/cache@v3
with:
key: Netch-${{ runner.os }}-Other-${{ env.SOURCE_OTHER_SHA256 }}
path: |
.\Other\release
- name: Cache Redirector
uses: actions/cache@v3
with:
key: Netch-${{ runner.os }}-Redirector-${{ env.SOURCE_REDIRECTOR_SHA256 }}
path: |
.\Redirector\bin
- name: Cache RouteHelper
uses: actions/cache@v3
with:
key: Netch-${{ runner.os }}-RouteHelper-${{ env.SOURCE_ROUTEHELPER_SHA256 }}
path: |
.\RouteHelper\bin
- name: Check Other
id: check_other
uses: andstor/file-existence-action@v2
with:
files: .\other\release\aiodns.bin
- name: Setup Go
uses: actions/setup-go@v3
if: steps.check_other.outputs.files_exists == 'false'
- name: Setup C++
uses: msys2/setup-msys2@v2
if: steps.check_other.outputs.files_exists == 'false'
with:
update: true
release: true
install: base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libevent mingw-w64-x86_64-pcre2 mingw-w64-x86_64-freetype mingw-w64-x86_64-libpng mingw-w64-x86_64-bzip2 mingw-w64-x86_64-openssl mingw-w64-x86_64-mbedtls mingw-w64-x86_64-libsodium mingw-w64-x86_64-c-ares mingw-w64-x86_64-boost mingw-w64-x86_64-libmariadbclient unzip p7zip autoconf automake libtool
- name: Setup Rust
uses: actions-rs/toolchain@v1
if: steps.check_other.outputs.files_exists == 'false'
with:
toolchain: nightly
profile: minimal
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1.3
with:
vs-prerelease: true
- name: Build
shell: pwsh
run: |
.\build.ps1 -Configuration Release -OutputPath release
- name: Upload
uses: actions/upload-artifact@v3
with:
name: release
path: release