Skip to content

GitHub Action - Release

Source: r.pkg.template/release.yaml at main ยท insightsengineering/r.pkg.template (github.com)

---
name: Release ๐Ÿš€

on:
  push:
    tags:
      - "v*"
  workflow_call:

jobs:
  release:
    name: Release ๐Ÿš€
    runs-on: ubuntu-latest
    if: "! contains(github.event.commits[0].message, '[skip release]')"
    permissions:
      contents: write
    steps:
      - name: Checkout repo ๐Ÿ›Ž
        uses: actions/checkout@v2

      - name: Generate Changelog ๐Ÿ“œ
        run: |
          RELEASE_VERSION=$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)
          REPOSITORY_NAME="${{ github.event.repository.name }}"
          (awk "/^#+.*${REPOSITORY_NAME//./\.}.*${RELEASE_VERSION//./\.}$/{flag=1;next}/^#+.*${REPOSITORY_NAME//./\.}.*/{flag=0}flag" NEWS.md | grep -v "^$" || echo "* ${RELEASE_VERSION}") > RELEASE_BODY.txt
      - name: Create release ๐ŸŒŸ
        uses: softprops/action-gh-release@v1
        with:
          body_path: RELEASE_BODY.txt
          token: ${{ secrets.GITHUB_TOKEN }}

Backlinks:

list from [[GitHub Action - Release]] AND -"Changelog"