Skip to content

Commit

Permalink
Merge pull request typecho#957 from starskim/master
Browse files Browse the repository at this point in the history
添加GitHub Actions Ci
  • Loading branch information
joyqi authored May 12, 2020
2 parents 6398551 + beeeab8 commit 371e6c9
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/Typecho-dev-Ci.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 35 additions & 0 deletions .github/workflows/Typecho-release-Ci.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 371e6c9

Please sign in to comment.