Files
Shortumation/.github/workflows/test-git-pr-pub.yml
T
2022-07-21 09:49:49 -04:00

41 lines
1.1 KiB
YAML

name: Build
on:
workflow_dispatch:
inputs:
version:
type: string
description: "Version Number"
push:
branch: [main]
jobs:
publish:
runs-on: ubuntu-latest
name: Publish Github Release
permissions:
contents: write
steps:
- name: Publish Release {{ github.event.inputs.version }}
uses: actions/github-script@v6
env:
VERSION: "{{ github.event.inputs.version }}"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: process.env.VERSION,
});
- name: Publish PreRelease {{ github.event.inputs.version }}
uses: actions/github-script@v6
env:
VERSION: pre-{{ github.event.inputs.version }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: process.env.VERSION,
});