From 7fbcc25fbee76eafab3a5cb88c710c3f8e3bb02e Mon Sep 17 00:00:00 2001 From: Futrime Date: Wed, 18 Oct 2023 14:21:49 +0800 Subject: [PATCH] ci: add GitHub Actions --- .github/workflows/build.yml | 28 +++++++++++++++++ .github/workflows/release.yml | 57 +++++++++++++++++++++++++++++++++++ CHANGELOG.md | 17 +++++++++++ 3 files changed, 102 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ec51d97 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +on: + pull_request: + push: + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - uses: xmake-io/github-action-setup-xmake@v1 + + - run: | + xmake repo -u + + - run: | + xmake f -a x64 -m release -p windows -v -y + + - run: | + xmake -w -y + + - uses: actions/upload-artifact@v3 + with: + name: movinglight-windows-x64-${{ github.sha }} + path: | + build/windows/x64/release/MovingLight.dll + build/windows/x64/release/MovingLight.pdb diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e4d6643 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +on: + release: + types: + - published + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - uses: xmake-io/github-action-setup-xmake@v1 + + - run: | + xmake repo -u + + - run: | + xmake f -a x64 -m release -p windows -v -y + + - run: | + xmake -w -y + + - uses: actions/upload-artifact@v3 + with: + name: movinglight-windows-x64-${{ github.sha }} + path: | + build/windows/x64/release/MovingLight.dll + build/windows/x64/release/MovingLight.pdb + + upload-to-release: + needs: + - build + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v3 + with: + name: movinglight-windows-x64-${{ github.sha }} + path: bin + + - run: | + cp CHANGELOG.md LICENSE README.md bin/ + + - name: Archive release + run: | + cd bin + zip -r ../movinglight-windows-x64.zip * + cd .. + + - uses: softprops/action-gh-release@v1 + with: + append_body: true + files: | + movinglight-windows-x64.zip diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1cf61b9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [2.3.0] - 2023-10-18 + +### Changed + +- Adapt to BDS 1.20.31 and LiteLoaderBDS 2.16.2. + +[Unreleased]: https://github.com/Futrime/CSharpProjectTemplate/compare/v2.3.0...HEAD +[2.3.0]: https://github.com/Futrime/CSharpProjectTemplate/releases/tag/v2.3.0