test act runner
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
18
.gitea/workflows/build.yml
Normal file
18
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: Gitea Actions Demo
|
||||||
|
run-name: ${{ github.actor }} is testing out Gitea Actions
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
Explore-Gitea-Actions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: echo " The job was automatically triggered by a ${{ github.event_name }} event."
|
||||||
|
- run: echo " This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||||
|
- run: echo " The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- run: echo " The ${{ github.repository }} repository has been cloned to the runner."
|
||||||
|
- run: echo " ️ The workflow is now ready to test your code on the runner."
|
||||||
|
- name: List files in the repository
|
||||||
|
run: |
|
||||||
|
ls ${{ github.workspace }}
|
||||||
|
- run: echo " This job's status is ${{ job.status }}."
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
name: Release Build
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags: ['v*']
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: '版本号 (如: 1.0.0)'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
VERSION: ${{ github.event.inputs.version || github.ref_name }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- platform: linux
|
|
||||||
arch: x86_64
|
|
||||||
runner: ubuntu-latest
|
|
||||||
- platform: linux
|
|
||||||
arch: aarch64
|
|
||||||
runner: ubuntu-22.04-arm
|
|
||||||
- platform: windows
|
|
||||||
arch: x86_64
|
|
||||||
runner: windows-latest
|
|
||||||
- platform: macos
|
|
||||||
arch: x86_64
|
|
||||||
runner: macos-12
|
|
||||||
- platform: macos
|
|
||||||
arch: arm64
|
|
||||||
runner: macos-14
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Install xmake
|
|
||||||
run: |
|
|
||||||
curl -fsSL https://xmake.io/shget.text | bash
|
|
||||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: Configure
|
|
||||||
run: |
|
|
||||||
if [ "${{ matrix.platform }}" = "windows" ]; then
|
|
||||||
xmake f -p mingw -a ${{ matrix.arch }} -m release
|
|
||||||
else
|
|
||||||
xmake f -p ${{ matrix.platform }} -a ${{ matrix.arch }} -m release
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: xmake -j4
|
|
||||||
|
|
||||||
- name: Create Package
|
|
||||||
run: |
|
|
||||||
mkdir -p Fig-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}
|
|
||||||
# 复制可执行文件
|
|
||||||
if [ "${{ matrix.platform }}" = "windows" ]; then
|
|
||||||
cp build/mingw/${{ matrix.arch }}/release/Fig.exe Fig-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}/
|
|
||||||
else
|
|
||||||
cp build/${{ matrix.platform }}/${{ matrix.arch }}/release/Fig Fig-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}/
|
|
||||||
fi
|
|
||||||
# 复制 Library 目录
|
|
||||||
cp -r src/Module/Library Fig-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}/
|
|
||||||
|
|
||||||
# 创建压缩包
|
|
||||||
if [ "${{ matrix.platform }}" = "windows" ]; then
|
|
||||||
zip -r Fig-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}.zip Fig-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}
|
|
||||||
else
|
|
||||||
tar -czf Fig-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz Fig-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 生成 checksum
|
|
||||||
sha256sum Fig-${{ env.VERSION }}-*.tar.gz Fig-${{ env.VERSION }}-*.zip 2>/dev/null | grep -v "No such file" > checksums.txt || true
|
|
||||||
|
|
||||||
- name: Upload Artifacts
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: binaries-${{ matrix.platform }}-${{ matrix.arch }}
|
|
||||||
path: |
|
|
||||||
Fig-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}.*
|
|
||||||
checksums.txt
|
|
||||||
|
|
||||||
release:
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Download all artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
**/*.tar.gz
|
|
||||||
**/*.zip
|
|
||||||
**/checksums.txt
|
|
||||||
generate_release_notes: true
|
|
||||||
Reference in New Issue
Block a user