Skip to content

Universal sdk code snippets #214

Universal sdk code snippets

Universal sdk code snippets #214

Workflow file for this run

name: Tag
on:
push:
tags:
- "v*"
pull_request:
types: [closed]
branches:
- main
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
version:
runs-on: ubuntu-latest
if: ${{ (startsWith(github.head_ref, 'release/v') && github.event.pull_request.merged) || startsWith(github.ref, 'refs/tags/v') }}
outputs:
version: ${{ env.VERSION }}
steps:
- id: is-release-merged
if: ${{ startsWith(github.head_ref, 'release/v') && github.event.pull_request.merged }}
run: |
VERSION=${GITHUB_HEAD_REF##*/}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: tag-release
if: ${{ startsWith(github.head_ref, 'release/v') && github.event.pull_request.merged }}
uses: mathieudutour/[email protected]
with:
create_annotated_tag: true
custom_tag: ${{ env.VERSION }}
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: ""
- id: is-tag
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
build-release:
name: Release
runs-on: ubuntu-latest
needs: version
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create changelog
id: changelog
if: ${{ !contains(needs.version.outputs.version, '-') }}
uses: mikepenz/[email protected]
with:
ignorePreReleases: true
configuration: .github/changelog.json
toTag: ${{ needs.version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish release
uses: softprops/[email protected]
with:
files: releases/*
body: ${{ steps.changelog.outputs.changelog }}
tag_name: ${{ needs.version.outputs.version }}
prerelease: ${{ contains(needs.version.outputs.version, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}