mirror of
https://github.com/bitwarden/self-host.git
synced 2026-06-28 14:25:45 +00:00
- Adds version.json with core, web, and KC versions - Updated bitwarden scripts to query VERSION_ENDPOINT - VERSION_ENDPOINT is set to rebrandly link, redirecting to version.json - Workflows updated to handle new link, version.json, and version bumps.
77 lines
2.3 KiB
YAML
77 lines
2.3 KiB
YAML
---
|
|
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
release_version:
|
|
description: "Release Version"
|
|
required: true
|
|
|
|
jobs:
|
|
setup:
|
|
name: Setup
|
|
runs-on: ubuntu-20.04
|
|
outputs:
|
|
branch-name: ${{ steps.branch.outputs.branch-name }}
|
|
steps:
|
|
- name: Branch check
|
|
run: |
|
|
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix" ]]; then
|
|
echo "==================================="
|
|
echo "[!] Can only release from the 'rc' or 'hotfix' branches"
|
|
echo "==================================="
|
|
exit 1
|
|
fi
|
|
|
|
- name: Checkout repo
|
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
|
|
|
- name: Get Latest Self-Host Version
|
|
id: get-self-host
|
|
uses: bitwarden/gh-actions/get-release-version@664c8899c95490c65dac0df11519d24ed8419c85
|
|
with:
|
|
repository: bitwarden/self-host
|
|
|
|
- name: Check Release Version
|
|
env:
|
|
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
|
|
PREVIOUS_RELEASE_VERSION: ${{ steps.get-self-host.outputs.version }}
|
|
run: |
|
|
if [ "$RELEASE_VERSION" == "$PREVIOUS_RELEASE_VERSION" ]; then
|
|
echo "[!] Already released v$RELEASE_VERSION. Please bump version to continue"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Get branch name
|
|
id: branch
|
|
run: |
|
|
BRANCH_NAME=$(basename ${{ github.ref }})
|
|
echo "::set-output name=branch-name::$BRANCH_NAME"
|
|
|
|
|
|
release:
|
|
name: Create GitHub Release
|
|
runs-on: ubuntu-20.04
|
|
needs: setup
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
|
with:
|
|
ref: ${{ needs.setup.outputs.branch-name }}
|
|
|
|
- name: Create release
|
|
uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09
|
|
with:
|
|
artifacts: 'bitwarden.sh,
|
|
run.sh,
|
|
bitwarden.ps1,
|
|
run.ps1,
|
|
version.json'
|
|
commit: ${{ github.sha }}
|
|
tag: "v${{ github.event.inputs.release_version }}"
|
|
name: "Version ${{ github.event.inputs.release_version }}"
|
|
body: "<insert release notes here>"
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
draft: true
|