tikz-trackschematic/.github/workflows/release.yaml

57 lines
1.8 KiB
YAML

# github action to publish a release
#
name: "release"
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
tags:
- "v*"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: "checkout"
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
uses: actions/checkout@v2
- name: "create tikz-trackschematic package"
env:
TAG_NAME: ${{ contains(github.event.head_commit.message, '[commit var]') }}
run: chmod +x create-release.sh && ./create-release.sh -v ${TAG_NAME}
- name: "create release"
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: false
- name: "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: tikz-trackschematic-${TAG_NAME}.zip
asset_name: tikz-trackschematic-${TAG_NAME}.zip
asset_content_type: application/zip
- name: "publish release"
uses: StuYarrow/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: ${{ steps.create_release.outputs.id }}