Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Heathcliff <[email protected]>
  • Loading branch information
heathcliff26 committed Dec 31, 2023
1 parent 8a6f1a5 commit dbbbd02
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Release

on:
workflow_dispatch:
inputs:
draft:
description: "Create draft release"
type: boolean
default: true
update:
description: "Update existing release"
type: boolean
default: false
version:
description: "The version of the release"
type: string
required: true

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
with:
allowUpdates: ${{ inputs.update }}
artifactErrorsFailBuild: true
draft: ${{ inputs.draft }}
generateReleaseNotes: true
tag: "${{ inputs.version }}"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Generated go-test coverage reports
coverprofiles/

# Generated artifacts
out/
17 changes: 17 additions & 0 deletions hack/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -e

script_dir="$(dirname "${BASH_SOURCE[0]}" | xargs realpath)/.."

OUT_DIR="${script_dir}/out"

if [ ! -d "${OUT_DIR}" ]; then
mkdir "${OUT_DIR}"
fi

pushd "${script_dir}" >/dev/null

git archive -o "${OUT_DIR}/source.zip" HEAD

popd >/dev/null

0 comments on commit dbbbd02

Please sign in to comment.