Skip to content

Commit

Permalink
Merge pull request #22 from homebridge/update-release-process
Browse files Browse the repository at this point in the history
Update Release Process
  • Loading branch information
NorthernMan54 authored May 1, 2024
2 parents 6a39fff + 0374139 commit 6ae15f0
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 52 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/wiki-change-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Wiki Change Request
description: want change?
labels: ["wiki change request"]
body:
- type: markdown
attributes:
value: |
Please read the following before you start filling out this form:
* This form is for requesting changes to the Homebridge Organization wiki pages only.
- type: textarea
id: proposed-change
attributes:
label: Proposed Change
description: |
Please describe the change you would like to see made to the wiki page.
If you are requesting a new page, please describe the page you would like to see created.
placeholder: |
Tip: You can attach images or files by clicking this area to highlight it and then dragging files in.
validations:
required: true
- type: input
id: wiki-page
attributes:
label: Wiki Page Link
description: |
Please provide a link to the wiki page you would like to see changed.
If you are requesting a new page, please provide details of where you would like to see this page linked from.
validations:
required: true
11 changes: 11 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Add 'beta' label to any PR where the base branch name starts with `beta` or has a `beta` section in the name
beta:
- base-branch: ['^beta', 'beta', 'beta*']

# Add 'beta' label to any PR where the base branch name starts with `beta` or has a `beta` section in the name
alpha:
- base-branch: ['^alpha', 'alpha', 'alpha*']

# Add 'latest' label to any PR where the base branch name starts with `latest` or has a `latest` section in the name
latest:
- base-branch: ['^latest', 'latest', 'latest*']
21 changes: 21 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# The GitHub release configuration file: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes

changelog:
categories:
- title: Breaking Changes 🛠
labels:
- 'breaking change'
- title: Featured Changes ✨
labels:
- 'feature'
- 'enhancement'
- title: Bug Fixes 🐛
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: Other Changes
labels:
- "chore"
- "housekeeping"
- "*"
File renamed without changes.
97 changes: 62 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,55 @@
name: "Build Release and Publish to DEB Repo"
run-name: Build Release ${{ github.event.inputs.version }} from ${{ github.ref_name }}
run-name: Build Release ${{ github.ref }} from ${{ github.ref_name }}

on:
workflow_dispatch:
inputs:
version:
description: 'Version / Tag (x.x.x):'
required: true
release_type:
type: choice
description: Release Type
options:
- stable
- test
release:
types: [released, prereleased]

jobs:
release:
name: Create Release
tag:
name: Verify Release Tag
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- name: Get Release Tag
id: get_version
uses: jannemattila/get-version-from-tag@v3
- name: Tag Info
run: |
echo "Release Tag: ${{github.ref}}"
echo "Latest Tag: ${{ steps.get_version.outputs.version }}"
- name: Tag Info Matches
if: endsWith(github.ref, steps.get_version.outputs.version )
run: |
echo Latest Tag matches Release tag
- name: Tag Info Doesn't Match
if: ${{ !endsWith(github.ref, steps.get_version.outputs.version ) }}
run: |
echo Latest Tag does not matches Release tag
exit 1
release_type:
name: Release Type
needs: tag
runs-on: ubuntu-latest
outputs:
release_type: ${{ steps.stable_release.outputs.release_type || steps.test_release.outputs.release_type }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
prerelease: false
- name: Release Type - stable
id: stable_release
if: ${{ github.event.release.prerelease == false }}
run: |
echo "release_type=stable" >> "$GITHUB_OUTPUT"
- name: Release Type - test
id: test_release
if: ${{ github.event.release.prerelease == true }}
run: |
echo "release_type=test" >> "$GITHUB_OUTPUT"
build:
name: Build Packages
needs: release
needs: [tag, release_type]
name: Build Packages for (${{ matrix.name }}) v${{ needs.tag.outputs.version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -78,7 +93,7 @@ jobs:
- name: Linux - Build Package
if: runner.os == 'Linux'
run: |
docker run --rm -v $(pwd):/repo -e PKG_RELEASE_TYPE="${{ github.event.inputs.release_type }}" -e PKG_RELEASE_VERSION="${{ github.event.inputs.version }}" package-build
docker run --rm -v $(pwd):/repo -e PKG_RELEASE_TYPE="${{ needs.release_type.outputs.release_type }}" -e PKG_RELEASE_VERSION="${{ needs.tag.outputs.version }}" package-build
- name: Set variables
run: |
Expand All @@ -88,27 +103,27 @@ jobs:
uses: tubone24/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.event.inputs.version }}
TAG_NAME: ${{ needs.tag.outputs.version }}
with:
is_append_body: "Contents of ${{ matrix.QEMU_ARCH }} Package."

- name: update release
uses: tubone24/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.event.inputs.version }}
TAG_NAME: ${{ needs.tag.outputs.version }}
with:
body_path: ${{ env.BODY_FILE }}

- uses: AButler/[email protected]
with:
files: '*.deb;*.manifest'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.event.inputs.version }}
release-tag: ${{ needs.tag.outputs.version }}

update-apt-repo:
name: Publish to Repo
needs: build
needs: [tag, release_type, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -119,7 +134,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag: ${{ github.event.inputs.version }}
tag: ${{ needs.tag.outputs.version }}

- name: Download release assets
uses: dsaltares/[email protected]
Expand All @@ -146,7 +161,7 @@ jobs:
run: |
sudo chown -R $USER: repo/
deb-s3 upload \
--codename=${{ github.event.inputs.release_type }} \
--codename=${{ needs.release_type.outputs.release_type }} \
--preserve-versions \
--s3-region=us-west-2 \
--bucket repo.homebridge.io \
Expand All @@ -162,3 +177,15 @@ jobs:
secrets:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}

github-releases-to-discord:
name: Discord Webhooks
needs: [tag,release_type,build,update-apt-repo,purge_cloudflare_cache]
uses: homebridge/.github/.github/workflows/discord-webhooks.yml@latest
with:
title: "Homebridge APT Package Release"
description: |
Version `${{ needs.tag.outputs.version }}`
url: "https://github.com/homebridge/homebridge-apt-pkg/releases/tag/${{ needs.tag.outputs.version }}"
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL_LATEST }}
17 changes: 0 additions & 17 deletions .github/workflows/discord-webhooks.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Labeler

on:
pull_request_target: # required for auto labeler
types: [opened, reopened, synchronize]
workflow_dispatch:

jobs:
stale:
uses: homebridge/.github/.github/workflows/labeler.yml@latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: PR Labeler

on:
pull_request: # required for auto labeler
types: [opened, reopened, synchronize]
workflow_dispatch:

jobs:
stale:
uses: homebridge/.github/.github/workflows/pr-labeler.yml@latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release Drafter

on:
push:
branches: [latest]
pull_request: # required for autolabeler
branches: [latest]
types: [opened, reopened, synchronize, ready_for_review, review_requested]
workflow_dispatch:

jobs:
release-drafter:
uses: homebridge/.github/.github/workflows/release-drafter.yml@latest
secrets:
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6ae15f0

Please sign in to comment.