- You may pass data between steps in a workflow using environmental variables
- Some examples are based on
run
instruction, which may be easily replaces with another GitHub Action
Workflow
name: release
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
Workflow
name: release
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME_PREFIX: "Release: "
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
Workflow
name: release
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRE_RELEASE: "true"
RELEASE_NAME_SUFFIX: " (nightly build)"
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
Workflow
Can be set as global environmental variables or provided directly to the action
name: release
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: |
export PREFIX="Release: "
export SUFFIX=" (Codename: 'Ragnarok')"
echo "::set-env name=RELEASE_NAME_PREFIX::$PREFIX"
echo "::set-env name=RELEASE_NAME_SUFFIX::$SUFFIX"
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
Workflow
Can be set as global environmental variable or provided directly to the action
name: release
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: |
export TEXT="Release X"
echo "::set-env name=RELEASE_NAME::$TEXT"
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHANGELOG_FILE: "CHANGES.md"
ALLOW_EMPTY_CHANGELOG: "true"
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
Workflow
name: release
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: build/*.zip
Workflow
name: release
on:
push:
tags:
- "*"
jobs:
release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: anton-yurchenko/git-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
This will recreate a single released on each execution by deleting the previous release and creating a new one.
Changelog will be extracted from an Unreleased
scope inside a CHANGELOG.md file.
Because this is an "Unreleased" release, it will always be marked as a pre-release.
latest
tag will be used by default, this means that it will be moved with each execution and point to a different commit.
Workflow
name: release
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UNRELEASED: "update"
with:
args: linux-amd64
Identical to Unreleased but with a different git tag. (useful when latest
tag is used for something else)
Workflow
name: release
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UNRELEASED: "update"
UNRELEASED_TAG: future
with:
args: linux-amd64