feat: added CI
This commit is contained in:
67
.gitea/workflows/build-and-release.yml
Normal file
67
.gitea/workflows/build-and-release.yml
Normal file
@@ -0,0 +1,67 @@
|
||||
name: Build and Release Maubot Plugin
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Plugin
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.9
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install maubot-compiler
|
||||
|
||||
- name: Build Plugin
|
||||
run: |
|
||||
mbc build .
|
||||
env:
|
||||
MB_PLUGIN_DIR: ${{ github.workspace }}
|
||||
|
||||
- name: Upload Build Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: plugin
|
||||
path: dist/*.mbp
|
||||
|
||||
release:
|
||||
name: Release Plugin
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Download Build Artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: plugin
|
||||
|
||||
- name: Create Release
|
||||
uses: actions/create-release@v1
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
release_name: Release ${{ github.ref_name }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
body: |
|
||||
## Description
|
||||
Plugin Maubot compilé à partir du tag `${{ github.ref_name }}`.
|
||||
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: dist/*.mbp
|
||||
asset_name: plugin-${{ github.ref_name }}.mbp
|
||||
asset_content_type: application/octet-stream
|
||||
Reference in New Issue
Block a user