move env to top level

This commit is contained in:
softprops 2019-09-09 17:36:46 +09:00
parent cf0f3ebbb1
commit d27570c9ab
2 changed files with 27 additions and 5 deletions

View file

@ -27,12 +27,34 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@master uses: actions/checkout@master
- name: Release - name: Release
uses: docker://softprops/action-gh-release uses: softprops/action-gh-release
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
``` ```
You can also use push config tag filter
```yaml
name: Main
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Release
uses: softprops/action-gh-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
### ⬆️ Uploading release assets ### ⬆️ Uploading release assets
@ -61,7 +83,7 @@ jobs:
- name: Test - name: Test
run: cat Release.txt run: cat Release.txt
- name: Release - name: Release
uses: docker://softprops/action-gh-release uses: softprops/action-gh-release
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
with: with:
files: Release.txt files: Release.txt
@ -89,7 +111,7 @@ jobs:
- name: Generate Changelog - name: Generate Changelog
run: echo "# Good things have arrived" > ${{ github.workflow }}-CHANGELOG.txt run: echo "# Good things have arrived" > ${{ github.workflow }}-CHANGELOG.txt
- name: Release - name: Release
uses: docker://softprops/action-gh-release uses: softprops/action-gh-release
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
with: with:
body_path: ${{ github.workflow }}-CHANGELOG.txt body_path: ${{ github.workflow }}-CHANGELOG.txt

View file

@ -23,13 +23,13 @@ inputs:
description: 'Comma-delimited list of path globs for asset files to upload' description: 'Comma-delimited list of path globs for asset files to upload'
required: false required: false
default: 'empty' default: 'empty'
env:
'GITHUB_TOKEN': 'As provided by Github Actions'
runs: runs:
#using: 'docker' #using: 'docker'
#image: 'docker://softprops:action-gh-action' #image: 'docker://softprops:action-gh-action'
using: 'node12' using: 'node12'
main: 'lib/main.js' main: 'lib/main.js'
env:
'GITHUB_TOKEN': 'As provided by Github Actions'
branding: branding:
color: 'green' color: 'green'
icon: 'package' icon: 'package'