chore:test github action

This commit is contained in:
hackycy
2020-06-24 22:00:12 +08:00
parent daa7a05e31
commit 2f4fb64935

View File

@@ -6,13 +6,15 @@ name: Build and Release apk
# 工作流程触发的时机,这里是当一个版本标签推送到仓库时触发 # 工作流程触发的时机,这里是当一个版本标签推送到仓库时触发
on: on:
release: push:
types: [published] # Sequence of patterns matched against refs/tags
tags:
- 'v*'
# 这个工作流程需要执行的任务 # 这个工作流程需要执行的任务
jobs: jobs:
process: build:
name: all process name: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
# 这个任务的步骤 # 这个任务的步骤
steps: steps:
@@ -26,9 +28,20 @@ jobs:
- run: flutter pub get - run: flutter pub get
# - run: flutter test # - run: flutter test
- run: flutter build apk --release - run: flutter build apk --release
- name: artifacts apk - name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Artifacts Apk
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
GITHUB_TOKEN: ${{ secrets.TOKEN }} GITHUB_TOKEN: ${{ secrets.TOKEN }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: "./build/app/outputs/apk/release/*.apk" asset_path: "./build/app/outputs/apk/release/*.apk"