Release from main by @ferc #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Internal release | |
name: "Release" | |
run-name: "Release from ${{github.ref_name}} by @${{ github.actor }}" | |
on: | |
workflow_dispatch: | |
jobs: | |
set-version: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Set version | |
id: version | |
run: | | |
echo "version=$(cat version.txt)" | tee -a $GITHUB_OUTPUT | |
create-git-tag: | |
needs: | |
- set-version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Create git tag | |
run: | | |
set -x | |
git config --local user.email "github-actions@comet.com" | |
git config --local user.name "github-actions" | |
git tag ${{needs.set-version.outputs.version}} | |
git push --no-verify origin ${{needs.set-version.outputs.version}} | |
release-apps: | |
needs: | |
- set-version | |
- create-git-tag | |
uses: ./.github/workflows/build_apps.yml | |
secrets: inherit | |
with: | |
version: ${{needs.set-version.outputs.version}} | |
release-sdk: | |
needs: | |
- set-version | |
- create-git-tag | |
uses: ./.github/workflows/build_and_publish_sdk.yaml | |
secrets: inherit | |
with: | |
version: ${{needs.set-version.outputs.version}} | |
is_release: true | |
publish-helm-chart: | |
needs: | |
- set-version | |
- create-git-tag | |
uses: ./.github/workflows/publish_helm_chart.yaml | |
secrets: inherit | |
with: | |
version: ${{needs.set-version.outputs.version}} | |
release-installer: | |
needs: | |
- set-version | |
- create-git-tag | |
uses: ./.github/workflows/build_and_publish_installer.yaml | |
secrets: inherit | |
with: | |
version: ${{needs.set-version.outputs.version}} | |
is_release: true | |
update_version_txt: | |
needs: | |
- set-version | |
- create-git-tag | |
- release-apps | |
- release-sdk | |
- publish-helm-chart | |
- release-installer | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
with: | |
ref: main | |
fetch-depth: 0 | |
token: ${{ secrets.GH_PAT_TO_ACCESS_GITHUB_API }} | |
- name: Bump version on main branch | |
id: update_version | |
shell: bash | |
run: | | |
set -x | |
BASE_VERSION=$(cat version.txt) | |
IFS='.' read -r -a version_parts <<< "$BASE_VERSION" | |
((version_parts[2]++)) | |
new_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}" | |
# Update version file with the new version | |
echo "$new_version" > version.txt | |
echo "new_version=${new_version}" >> $GITHUB_OUTPUT | |
- name: Commit updated version file | |
shell: bash | |
run: | | |
git config --local user.email "github-actions@comet.com" | |
git config --local user.name "github-actions" | |
git commit -a -m "Update base version to ${{steps.update_version.outputs.new_version}}" | |
echo "Version updated to ${{steps.update_version.outputs.new_version}} on main" >> $GITHUB_STEP_SUMMARY | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GH_PAT_TO_ACCESS_GITHUB_API }} | |
branch: ${{ github.ref }} | |
force_with_lease: true | |
create-github-release: | |
needs: | |
- set-version | |
- create-git-tag | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create Release Changelog | |
id: release_changelog | |
uses: jaywcjlove/changelog-generator@v1.9.6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
show-emoji: "false" | |
- name: Create GitHub release | |
uses: mikepenz/action-gh-release@v0.4.1 | |
with: | |
tag_name: ${{needs.set-version.outputs.version}} | |
body: ${{steps.release_changelog.outputs.changelog}} | |
generate_release_notes: true |