Skip to content

Commit

Permalink
Add release ci
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia committed Aug 31, 2023
1 parent e961578 commit 4e44f36
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: Breaking Changes 🚨
labels:
- breaking-change
- title: Exciting New Features 🎉
labels:
- enhancement
- title: Preview features 🍪
labels:
- preview-feature
- title: Bugs fixed 🐛
labels:
- bug
- title: Other Changes
labels:
- "*"
42 changes: 42 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# https://docs.github.com/en/actions

name: "Release"

on: # yamllint disable-line rule:truthy
push:
tags:
- "**"

permissions: write-all
jobs:
release:
permissions: write-all
name: "Release"
runs-on: "ubuntu-latest"

steps:
- name: "Determine tag"
run: 'echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV'

- name: "Create release"
uses: "actions/github-script@v6"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
const tag = process.env.RELEASE_TAG;
try {
const response = await github.rest.repos.createRelease({
draft: false,
generate_release_notes: true,
name: `Release ${tag}`,
owner: context.repo.owner,
prerelease: tag.includes("rc-") || tag.includes("preview") || tag.includes("beta") || tag.includes("alpha"),
repo: context.repo.repo,
tag_name: tag,
});
core.exportVariable('RELEASE_ID', response.data.id);
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url);
} catch (error) {
core.setFailed(error.message);
}

0 comments on commit 4e44f36

Please sign in to comment.