Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

build: add workflow #10

build: add workflow

build: add workflow #10

Workflow file for this run

on:
push:
branches:
- master
- dev
paths:
- .github/workflows/build.yml
- scripts/localbdslibrary.lua
- src/**
- xmake.lua
pull_request:
branches:
- master
- dev
paths:
- .github/workflows/build.yml
- scripts/localbdslibrary.lua
- src/**
- xmake.lua
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Read bdsversion file
id: read-bdsversion
run: |
$content = Get-Content -Path .\bdsversion -Raw
$type = ($content | Select-String -Pattern 'type=(.*)' | ForEach-Object { $_.Matches.Groups[1].Value }).Trim()
$version = ($content | Select-String -Pattern 'version=(.*)' | ForEach-Object { $_.Matches.Groups[1].Value }).Trim()
echo "::set-output name=version_type::$type"
echo "::set-output name=version_number::$version"
printf '%s\n' "$type"
printf '%s\n' "$version"
- uses: xmake-io/github-action-setup-xmake@v1
- uses: actions/cache@v3
with:
path: |
~/AppData/Local/.xmake
.xmake
build/bds/lib
key: |
xmake-dataextractor-windows-x64-${{ github.sha }}
xmake-dataextractor-windows-x64-${{ github.sha }}
bdslib-${{ steps.read-bdsversion.outputs.version_type }}-${{ steps.read-bdsversion.outputs.version_number }}
restore-keys: |
xmake-dataextractor-windows-x64-
xmake-dataextractor-windows-x64-
- run: |
xmake repo -u
- run: |
xmake bds-lib -b --${{ steps.read-bdsversion.outputs.version_type }}=${{ steps.read-bdsversion.outputs.version_number }}
- run: |
xmake f -a x64 -m release -p windows -v -y --ccache=n
- run: |
xmake -w -y
- uses: actions/upload-artifact@v3
with:
name: DataExtractor-Windows-X64-${{ github.sha }}
path: |
build/windows/x64/release/DataExtractor.dll
build/windows/x64/release/DataExtractor.pdb