60 lines
1.7 KiB
YAML
Raw Normal View History

name: Release
on:
2024-04-27 19:56:54 +08:00
workflow_dispatch:
2024-04-26 05:53:33 +08:00
jobs:
build:
runs-on: windows-latest
2024-04-26 17:18:10 +08:00
strategy:
matrix:
include:
- architecture: x86
2024-04-26 19:24:31 +08:00
fname: LunaTranslator_x86
2024-04-26 17:18:10 +08:00
- architecture: x64
2024-04-26 19:24:31 +08:00
fname: LunaTranslator
2024-08-09 14:13:42 +08:00
permissions:
id-token: write
attestations: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Windows 10 SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22621
2024-06-25 03:21:56 +08:00
- name: Install Python
uses: actions/setup-python@v5
with:
2024-06-25 17:53:01 +08:00
python-version: '3.7.9'
2024-04-26 17:18:10 +08:00
architecture: ${{ matrix.architecture }}
2024-05-01 22:25:00 +08:00
- name: Install Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
2024-08-09 14:16:41 +08:00
- name: Run build script
run: |
2024-10-18 20:03:38 +08:00
python src/build.py ${{ matrix.architecture }} 3.7.9
2024-09-09 02:04:33 +08:00
# - name: Generate attestation for artifact
# uses: actions/attest-build-provenance@v1
# with:
# subject-path: build/${{ matrix.fname }}.zip
2024-04-26 17:18:10 +08:00
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.fname }}
2024-04-26 19:24:31 +08:00
path: build/${{ matrix.fname }}.zip
2024-08-09 14:13:42 +08:00
2024-04-27 20:36:26 +08:00
- name: loadversion
id: loadversion
2024-10-18 20:03:38 +08:00
run: python src/build.py loadversion | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Release LunaTranslator
uses: softprops/action-gh-release@v2
with:
2024-04-27 20:36:26 +08:00
tag_name: ${{ steps.loadversion.outputs.version }}
2024-04-28 00:50:54 +08:00
files: |
2024-10-18 20:03:38 +08:00
src/build/${{ matrix.fname }}.zip
src/build/${{ matrix.fname }}.exe
env:
2024-04-26 17:18:10 +08:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}