Files
discordeno/.github/workflows/release.yml
2022-02-25 18:44:41 +00:00

29 lines
888 B
YAML

name: Release
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
deno: ["v1.x"]
steps:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@main
with:
deno-version: ${{ matrix.deno }}
# Taken from: https://github.com/denoland/dnt#github-actions---npm-publish-on-tag
- name: Get tag version
id: get_tag_version
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
- name: Get new tag version
run: echo "DISCORDENO_VERSION=$(cat util/constants.ts | grep 'export const DISCORDENO_VERSION' | awk -F'= ' '{print $2}' | tr -d '"|;')" >> $GITHUB_ENV
- name: Create tag
if: ${{ env.DISCORDENO_VERSION != steps.get_tag_version.outputs.TAG_VERSION }}
run: git tag ${{ env.DISCORDENO_VERSION }} && git push --tags