2022-02-14 17:23:37 +01:00
|
|
|
### github action to make and publish a release
|
|
|
|
##
|
|
|
|
name: release
|
2022-02-13 20:17:04 +01:00
|
|
|
|
2022-02-14 17:23:37 +01:00
|
|
|
## Controls when the workflow will run
|
2022-02-13 20:17:04 +01:00
|
|
|
on:
|
2022-02-14 17:23:37 +01:00
|
|
|
## Triggers the workflow on push or pull request events but only for the master branch
|
2022-02-13 20:17:04 +01:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*"
|
|
|
|
|
2022-02-14 17:23:37 +01:00
|
|
|
## A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
2022-02-13 20:17:04 +01:00
|
|
|
jobs:
|
2022-02-14 14:27:22 +01:00
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
2022-02-13 20:17:04 +01:00
|
|
|
steps:
|
|
|
|
- name: "checkout"
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2022-02-14 17:23:37 +01:00
|
|
|
## create varibale ${{ steps.tag.outputs.tag }}
|
|
|
|
- name: "get tag"
|
|
|
|
id: tag
|
|
|
|
uses: dawidd6/action-get-tag@v1
|
|
|
|
with:
|
|
|
|
# Optionally strip `v` prefix
|
|
|
|
strip_v: false
|
|
|
|
|
2022-02-13 20:17:04 +01:00
|
|
|
- name: "create tikz-trackschematic package"
|
2022-03-10 15:41:17 +01:00
|
|
|
run: ./build.sh --non-interactive --release ${{ steps.tag.outputs.tag }}
|
2022-02-13 20:17:04 +01:00
|
|
|
|
|
|
|
- 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 }}
|
2022-02-15 16:17:24 +01:00
|
|
|
body_path: release-note-${{ steps.tag.outputs.tag }}.md
|
2022-02-13 20:17:04 +01:00
|
|
|
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 }}
|
2022-02-14 17:23:37 +01:00
|
|
|
asset_path: tikz-trackschematic-${{ steps.tag.outputs.tag }}.zip
|
|
|
|
asset_name: tikz-trackschematic-${{ steps.tag.outputs.tag }}.zip
|
2022-02-13 20:17:04 +01:00
|
|
|
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 }}
|