Compare commits

..

1 Commits

Author SHA1 Message Date
Gitea Actions
bb37cd9091 Update submodule to Cal.com version v5.3.9 2025-06-11 13:52:35 +00:00
3 changed files with 49 additions and 62 deletions

View File

@@ -1,77 +1,60 @@
name: "Create Gitea Release" name: "Create Release"
# This workflow is triggered manually from the Gitea Actions UI on: # yamllint disable-line rule:truthy
on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
RELEASE_TAG: RELEASE_TAG:
description: 'The release tag to create, formatted as v{Major}.{Minor}.{Patch}' description: 'v{Major}.{Minor}.{Patch}'
required: true
jobs: jobs:
release: release:
name: "Release" name: "Release"
permissions:
contents: write
runs-on: "ubuntu-latest" runs-on: "ubuntu-latest"
steps: steps:
# Step 1: Check out the repository source code and its submodules.
# The TOKEN_GITEA is used here to grant permission for the later 'git push'.
- name: Checkout source - name: Checkout source
uses: "actions/checkout@v4" uses: actions/checkout@v3
with: with:
token: ${{ secrets.TOKEN_GITEA }} token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
submodules: true submodules: true
# Step 2: Create a new release branch, update the submodule to the specified tag, - name: Create branch and tag submodule
# and push the new branch to the Gitea repository.
- name: Create Branch and Update Submodule
run: | run: |
# Configure git user for the commit git config user.email "actions@github.com"
git config user.email "actions@gitea.local" git config user.name "actions-user"
git config user.name "Gitea Actions" git submodule update --init --remote
# Create the new release branch
git checkout -b 'release-${{ inputs.RELEASE_TAG }}' git checkout -b 'release-${{ inputs.RELEASE_TAG }}'
# Enter the submodule directory, fetch the latest tags, and check out the correct one.
# This points the submodule to the specific commit associated with the release tag.
(cd calcom && git fetch --tags origin && git checkout 'refs/tags/${{ inputs.RELEASE_TAG }}') (cd calcom && git fetch --tags origin && git checkout 'refs/tags/${{ inputs.RELEASE_TAG }}')
# Stage and commit the change to the submodule pointer
git add calcom git add calcom
git commit -m "Update submodule to Cal.com version ${{ inputs.RELEASE_TAG }}" git commit -m "tag version Cal.com version ${{ inputs.RELEASE_TAG }}"
# Push the newly created release branch to the remote Gitea repository
git push origin 'release-${{ inputs.RELEASE_TAG }}' git push origin 'release-${{ inputs.RELEASE_TAG }}'
# Step 3: Call the Gitea API to create the official release object. # note: instead of secrets.GITHUB_TOKEN here, we need to use a PAT
# This uses the same API token to authorize the action. # so that the release creation triggers the image build workflow
- name: "Create Gitea Release" - name: "Create release"
env: uses: "actions/github-script@v6"
GITEA_TOKEN: ${{ secrets.TOKEN_GITEA }} with:
GITEA_API_URL: https://git.nethery.dev/api/v1 github-token: "${{ secrets.ACTIONS_ACCESS_TOKEN }}"
OWNER: ${{ gitea.repository_owner }} script: |
REPO: ${{ gitea.repository_name }} const isPreRelease = '${{ inputs.RELEASE_TAG }}'.includes('-rc');
run: | try {
# Determine if the tag indicates a pre-release const response = await github.rest.repos.createRelease({
is_prerelease=false draft: false,
if [[ "${{ inputs.RELEASE_TAG }}" == *"-rc"* || "${{ inputs.RELEASE_TAG }}" == *"-beta"* ]]; then generate_release_notes: true,
is_prerelease=true body: 'For Cal.com release details, see: https://github.com/calcom/cal.com/releases/tag/${{ inputs.RELEASE_TAG }}',
fi name: '${{ inputs.RELEASE_TAG }}',
target_commitish: 'release-${{ inputs.RELEASE_TAG }}',
owner: context.repo.owner,
prerelease: isPreRelease,
repo: context.repo.repo,
tag_name: '${{ inputs.RELEASE_TAG }}',
});
echo "Creating release ${{ inputs.RELEASE_TAG }}..." core.exportVariable('RELEASE_ID', response.data.id);
echo "Is prerelease: $is_prerelease" core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url);
} catch (error) {
# Use curl to send a POST request to the Gitea API's 'create release' endpoint core.setFailed(error.message);
curl --fail --silent --show-error -L -X POST \ }
-H "accept: application/json" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
"${GITEA_API_URL}/repos/${OWNER}/${REPO}/releases" \
-d '{
"tag_name": "${{ inputs.RELEASE_TAG }}",
"target_commitish": "release-${{ inputs.RELEASE_TAG }}",
"name": "${{ inputs.RELEASE_TAG }}",
"body": "For Cal.com release details, see: https://github.com/calcom/cal.com/releases/tag/${{ inputs.RELEASE_TAG }}",
"prerelease": '${is_prerelease}'
}'

View File

@@ -61,11 +61,15 @@ jobs:
run: | run: |
git submodule update --init git submodule update --init
- name: Log in to the Docker Hub registry # - name: Log in to the Docker Hub registry
uses: docker/login-action@v3 # uses: docker/login-action@v3
with: # with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} # # Username used to log against the Docker registry
password: ${{ secrets.DOCKER_HUB_TOKEN }} # username: ${{ secrets.DOCKER_HUB_USERNAME }}
# # Password or personal access token used to log against the Docker registry
# password: ${{ secrets.DOCKER_HUB_TOKEN }}
# # Log out from the Docker registry at the end of a job
# logout: true # optional, default is true
- name: Log in to the Github Container registry - name: Log in to the Github Container registry
uses: docker/login-action@v3 uses: docker/login-action@v3
@@ -80,7 +84,7 @@ jobs:
with: with:
images: | images: |
ghcr.io/nnethery/cal.com ghcr.io/nnethery/cal.com
nnethery/cal.com # Add flavor latest only on full releases, not on pre-releases
flavor: | flavor: |
latest=${{ !github.event.release.prerelease }} latest=${{ !github.event.release.prerelease }}

2
calcom

Submodule calcom updated: ddc5838c7b...899da51f06