2023-07-24 16:09:12 +00:00
|
|
|
name: "Release Docker"
|
|
|
|
|
|
|
|
on: # yamllint disable-line rule:truthy
|
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- created
|
|
|
|
# in case manual trigger is needed
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
RELEASE_TAG:
|
2023-08-15 00:42:10 +00:00
|
|
|
description: "v{Major}.{Minor}.{Patch}"
|
2023-07-24 16:09:12 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: "Remote Release"
|
|
|
|
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: "Determine tag"
|
2023-08-15 00:42:10 +00:00
|
|
|
run: 'echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV'
|
2023-07-24 16:09:12 +00:00
|
|
|
|
|
|
|
- name: "Run remote release workflow"
|
|
|
|
uses: "actions/github-script@v6"
|
|
|
|
with:
|
|
|
|
# Requires a personal access token with Actions Read and write permissions on calcom/docker.
|
|
|
|
github-token: "${{ secrets.DOCKER_REPO_ACCESS_TOKEN }}"
|
|
|
|
script: |
|
|
|
|
try {
|
|
|
|
const response = await github.rest.actions.createWorkflowDispatch({
|
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: 'docker',
|
|
|
|
workflow_id: 'create-release.yaml',
|
|
|
|
ref: 'main',
|
|
|
|
inputs: {
|
2023-07-25 10:45:56 +00:00
|
|
|
"RELEASE_TAG": process.env.RELEASE_TAG
|
2023-07-24 16:09:12 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
console.log(response);
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error);
|
|
|
|
core.setFailed(error.message);
|
|
|
|
}
|