mirror of
https://github.com/typecho/typecho.git
synced 2025-01-17 20:48:42 +01:00
添加GitHub Actions Ci
This commit is contained in:
parent
5ba2f03206
commit
beeeab869d
46
.github/workflows/Typecho-dev-Ci.yml
vendored
Normal file
46
.github/workflows/Typecho-dev-Ci.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
name: Typecho Build Dev Ci
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
php:
|
||||
name: PHP ${{ matrix.php }} Tests
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php: ['7.0','7.2', '7.3', '7.4']
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup PHP only
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
- name: Test
|
||||
run: |
|
||||
cd ./tools/
|
||||
make test
|
||||
build:
|
||||
name: Typecho Build
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Install tree
|
||||
run: sudo apt-get -y install tree
|
||||
- name: Build
|
||||
run: |
|
||||
cd ./tools/
|
||||
make update
|
||||
make rm
|
||||
mkdir build/usr/uploads/
|
||||
chmod 777 build/usr/uploads/
|
||||
tree -d build
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: typecho_build
|
||||
path: ./tools/build/
|
35
.github/workflows/Typecho-release-Ci.yml
vendored
Normal file
35
.github/workflows/Typecho-release-Ci.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
name: Typecho Build Release Ci
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: |
|
||||
cd ./tools/
|
||||
make all
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Typecho ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
- name: Upload Release Asset
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./tools/build.tar.gz
|
||||
asset_name: Typecho-build.tar.gz
|
||||
asset_content_type: application/gzip
|
Loading…
x
Reference in New Issue
Block a user