Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
arnested committed Dec 6, 2024
1 parent 5c88044 commit 2c4b1b7
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Release

on:
workflow_run:
workflows: ["php", "links"]
branches: [main]
types:
- completed

permissions:
actions: read
contents: write

jobs:
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.71.0
id: version
env:
GITHUB_TOKEN: ${{ github.token }}
WITH_V: true
DEFAULT_BUMP: patch
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
RELEASE_BRANCHES: main
- name: Create release
uses: actions/github-script@v7
if: ${{ steps.version.outputs.new_tag }}
env:
RELEASE_TAG: ${{ steps.version.outputs.new_tag }}
with:
script: |
try {
await github.rest.repos.createRelease({
draft: false,
generate_release_notes: true,
name: process.env.RELEASE_TAG,
owner: context.repo.owner,
prerelease: false,
repo: context.repo.repo,
tag_name: process.env.RELEASE_TAG,
});
} catch (error) {
core.setFailed(error.message);
}

0 comments on commit 2c4b1b7

Please sign in to comment.