forked from typecho/typecho
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request typecho#957 from starskim/master
添加GitHub Actions Ci
- Loading branch information
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |