Skip to content

Commit

Permalink
Merge pull request #265 from calcom/feat/actions-auto-release
Browse files Browse the repository at this point in the history
Feat/actions auto release
  • Loading branch information
krumware authored Jun 28, 2023
2 parents 29994d5 + 2ab6ff4 commit 2fda384
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
57 changes: 57 additions & 0 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Create Release"

on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
RELEASE_TAG:
description: 'v{Major}.{Minor}.{Patch}'

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

steps:

- name: Checkout source
uses: actions/checkout@v3
with:
token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
submodules: true

- name: Create branch and tag submodule
run: |
git config user.email "actions@github.com"
git config user.name "actions-user"
git submodule update --init
git checkout -b 'release-${{ inputs.RELEASE_TAG }}'
(cd submodule-release-source && git checkout '${{ inputs.RELEASE_TAG }}')
git add submodule-release-source
git commit -m "tag version Cal.com version ${{ inputs.RELEASE_TAG }}"
git push origin 'release-${{ inputs.RELEASE_TAG }}'
- name: "Create release"
uses: "actions/github-script@v6"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
try {
const response = await github.rest.repos.createRelease({
draft: false,
generate_release_notes: true,
body: 'For Cal.com release details, see: /~https://github.com/calcom/cal.com/releases/tag/${{ inputs.RELEASE_TAG }}',
name: '${{ inputs.RELEASE_TAG }}',
target_commitish: 'release-${{ inputs.RELEASE_TAG }}',
owner: context.repo.owner,
prerelease: false,
repo: context.repo.repo,
tag_name: '${{ inputs.RELEASE_TAG }}',
});
core.exportVariable('RELEASE_ID', response.data.id);
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url);
} catch (error) {
core.setFailed(error.message);
}
2 changes: 1 addition & 1 deletion calcom
Submodule calcom updated 1 files
+1 −1 apps/web/package.json

0 comments on commit 2fda384

Please sign in to comment.