Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions .github/workflows/publish-github-release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish GitHub release
name: Publish GitHub release — legacy path, please switch!

on:
workflow_call:
Expand All @@ -7,25 +7,4 @@ jobs:
Publish:
permissions:
contents: write
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Calculate release name
run: |
GITHUB_REF=${{ github.ref }}
RELEASE_NAME=${GITHUB_REF#"refs/tags/"}
echo "RELEASE_NAME=${RELEASE_NAME}" >> $GITHUB_ENV
# We'd use `github.event.head_commit.message`, but that includes the first line of the message. So we check out the code.
- name: Check out code for release body calculation using `git` itself
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Calculate release body
run: git log --format=%b -n 1 HEAD >> /tmp/body-path.txt
- name: Publish release
uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_NAME }}
body_path: /tmp/body-path.txt
draft: false
prerelease: false
uses: ./workflows/publish-github-release/workflow.yaml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/v')
uses: cubing/actions-workflows/.github/workflows/publish-github-release.yaml@main
uses: cubing/actions-workflows/workflows/publish-github-release@main
CONTENTS
```

Expand Down
31 changes: 31 additions & 0 deletions workflows/publish-github-release/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish GitHub release

on:
workflow_call:

jobs:
Publish:
permissions:
contents: write
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Calculate release name
run: |
GITHUB_REF=${{ github.ref }}
RELEASE_NAME=${GITHUB_REF#"refs/tags/"}
echo "RELEASE_NAME=${RELEASE_NAME}" >> $GITHUB_ENV
# We'd use `github.event.head_commit.message`, but that includes the first line of the message. So we check out the code.
- name: Check out code for release body calculation using `git` itself
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Calculate release body
run: git log --format=%b -n 1 HEAD >> /tmp/body-path.txt
- name: Publish release
uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_NAME }}
body_path: /tmp/body-path.txt
draft: false
prerelease: false
Loading