Skip to content

Commit

Permalink
Merge pull request #63 from dolthub/taylor/github-release
Browse files Browse the repository at this point in the history
.github: Release script
  • Loading branch information
tbantle22 authored Nov 29, 2023
2 parents d33f781 + e6b8e12 commit 2026717
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/cd-push-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
context: .
file: ./docker/Dockerfile
push: true
tags: dolthub/dolt-workbench:${{ github.event.inputs.version || github.event.client_payload.version }} , dolthub/dolt-workbench:latest
tags: dolthub/dolt-workbench:${{ github.event.inputs.version || github.event.client_payload.version }}
- name: Update Docker Hub README
uses: peter-evans/dockerhub-description@v3
with:
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/cd-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Release dolt-workbench

on:
workflow_dispatch:
inputs:
version:
description: 'SemVer format release tag, i.e. 0.24.5'
required: true

jobs:
format-version:
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.format_version.outputs.version }}
steps:
- name: Format Input
id: format_version
run: |
version="${{ github.event.inputs.version }}"
if [[ $version == v* ]];
then
version="${version:1}"
fi
echo "version=$version" >> $GITHUB_OUTPUT
create-release:
needs: format-version
name: Create release
runs-on: ubuntu-22.04
outputs:
release_id: ${{ steps.create_release.outputs.id }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: dolthub/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.format-version.outputs.version }}
release_name: ${{ needs.format-version.outputs.version }}
draft: false
prerelease: false

create-release-notes:
needs: [format-version, create-release]
runs-on: ubuntu-22.04
steps:
- name: Trigger Release Notes
uses: peter-evans/repository-dispatch@v2.0.0
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
event-type: release-notes
client-payload: '{"version": "${{ needs.format-version.outputs.version }}", "release_id": "${{ needs.create-release.outputs.release_id }}"}'

docker-image-push:
needs: [ format-version, create-release ]
runs-on: ubuntu-22.04
steps:
- name: Trigger Push Docker Image
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
event-type: push-docker-image
client-payload: '{"version": "${{ needs.format-version.outputs.version }}"}'

0 comments on commit 2026717

Please sign in to comment.