Skip to content

Commit

Permalink
Merge pull request #3385 from telepresenceio/shepz/automatate-release
Browse files Browse the repository at this point in the history
Automate current release workflow
  • Loading branch information
thallgren authored Nov 17, 2023
2 parents 8727682 + e0655de commit ba2d56c
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/prepare.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Prepare release

on:
push:
branches:
- 'release/[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- 'release/v2'
types: [ labeled ]

jobs:
check-commit:
if: (github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.label.name == 'GA' || github.event.label.name == 'RC') && startsWith(github.head_ref, 'release/2'))) && github.actor != 'd6e-automaton'
runs-on: ubuntu-latest
outputs:
is_prepare_release: ${{ steps.check.outputs.is_prepare_release }}
telepresence_version: ${{ steps.check.outputs.telepresence_version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check commit
id: check
uses: datawire/telepresence-internal-actions/check-commit@main

prepare-release:
runs-on: ubuntu-latest
needs: check-commit
steps:
- name: Prepare release
uses: datawire/telepresence-internal-actions/execute-release-commands@main
with:
gh_auto_release_token: ${{ secrets.GH_LOCAL_TOKEN }}
gh_auto_release_email: ${{ secrets.GH_AUTO_RELEASE_EMAIL }}
gh_auto_release_user: ${{ secrets.GH_AUTO_RELEASE_USER }}
telepresence_version: ${{ needs.check-commit.outputs.telepresence_version }}
repository: ${{ github.repository }}
pre_push_branch_commands: "make prepare-release"
post_push_branch_commands: "make push-tags"

slack-notification:
needs: [check-commit, prepare-release]
runs-on: ubuntu-latest
if: (needs.check-commit.result == 'failure' || needs.prepare-release.result == 'failure')
steps:
- name: Notify Developers about Workflow Error
id: slack
uses: datawire/telepresence-internal-actions/slack-notification-workflow-error@main
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ env.PRERELEASE }}
makeLatest: ${{ env.MAKE_LATEST }}
tag: ${{ github.ref_name }}
body: |
## Official Release Artifacts
### Linux
Expand All @@ -84,6 +85,13 @@ jobs:
And for more information, visit our [installation docs](https://www.telepresence.io/docs/latest/quick-start/).
![Assets](https://static.scarf.sh/a.png?x-pxid=d842651a-2e4d-465a-98e1-4808722c01ab)
- name: Notify Developers about Release
id: slack
uses: datawire/telepresence-internal-actions/slack-notification-release-success@main
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
telepresence_version: ${{ github.ref_name }}
telepresence_product: "OSS"

test-release:
needs: publish-release
Expand All @@ -103,3 +111,31 @@ jobs:
uses: ./.github/actions/test-release
with:
release_version: ${{ github.ref_name }}

trigger-pro-release:
runs-on: ubuntu-latest
needs:
- test-release
steps:
- name: Trigger other releases
id: trigger
uses: datawire/telepresence-internal-actions/execute-release-commands@main
with:
gh_auto_release_token: ${{ secrets.GH_AUTO_RELEASE_TOKEN }}
gh_auto_release_email: ${{ secrets.GH_AUTO_RELEASE_EMAIL }}
gh_auto_release_user: ${{ secrets.GH_AUTO_RELEASE_USER }}
telepresence_version: ${{ github.ref_name }}
repository: ${{ secrets.PRO_REPOSITORY_NAME }}
pre_push_branch_commands: "make prepare-release && make generate"
post_push_branch_commands: "make push-tags"

slack-notification:
needs: trigger-pro-release
runs-on: ubuntu-latest
if: always()
steps:
- name: Notify Developers about Workflow Error
id: slack
uses: datawire/telepresence-internal-actions/slack-notification-workflow-error@main
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion CHANGELOG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ items:
retrieval, has been removed. The functionality was instead added as a subcommand to the <code>telepresence
</code> binary.
- version: 2.16.1
date: "2023-10-03"
date: "2023-10-12"
notes:
- type: feature
title: Add --docker-debug flag to the telepresence intercept command.
Expand Down
5 changes: 5 additions & 0 deletions build-aux/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ prepare-release: generate wix
git tag --annotate --message='$(TELEPRESENCE_VERSION)' $(TELEPRESENCE_VERSION)
git tag --annotate --message='$(TELEPRESENCE_VERSION)' rpc/$(TELEPRESENCE_VERSION)

.PHONY: push-tags
push-tags:
git push origin $(TELEPRESENCE_VERSION)
git push origin rpc/$(TELEPRESENCE_VERSION)

# Prerequisites:
# The awscli command must be installed and configured with credentials to upload
# to the datawire-static-files bucket.
Expand Down

0 comments on commit ba2d56c

Please sign in to comment.