Skip to content

Commit

Permalink
ci: update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jcwillox committed Jun 10, 2024
1 parent 3e87c84 commit 7118fb1
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 70 deletions.
8 changes: 4 additions & 4 deletions .github/actions/addon-info/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ runs:
repository="$(echo "$raw_image" | cut -f 1 -d '/')"
image="$(echo "$raw_image" | cut -f 2- -d '/')"
echo "::set-output name=name::${name}"
echo "::set-output name=description::${description}"
echo "::set-output name=repository::${repository}"
echo "::set-output name=image::${image}"
echo "name=${name}" >> $GITHUB_OUTPUT
echo "description=${description}" >> $GITHUB_OUTPUT
echo "repository=${repository}" >> $GITHUB_OUTPUT
echo "image=${image}" >> $GITHUB_OUTPUT
yq -i ".args.BUILD_NAME=\"${name}\"" $TARGET/build.yaml
yq -i ".args.BUILD_DESCRIPTION=\"${description}\"" $TARGET/build.yaml
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Publish"

on:
release:
types: [published]

env:
TARGET: rclone_backup

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: "Checkout the repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main

- name: "Get addon information and update build args"
id: information
uses: ./.github/actions/addon-info

- name: "Login to GitHub Container Registry"
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: "Publish"
uses: home-assistant/builder@master
with:
args: |
--all \
--target ${{ env.TARGET }} \
--image ${{ steps.information.outputs.image }} \
--docker-hub ${{ steps.information.outputs.repository }} \
--release ${{ github.event.release.tag_name }}
55 changes: 55 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Release"

on:
push:
branches:
- "beta"
- "alpha"
workflow_dispatch:
inputs:
draft:
type: boolean
description: "Draft release"
default: false
release_type:
type: choice
description: "Release type"
default: "auto"
options:
- "auto"
- "patch"
- "minor"
- "major"

env:
TARGET: "rclone_backup"

jobs:
publish:
name: "Publish"
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: "Checkout the repository"
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "Setup node"
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: "Release Package 📦"
run: corepack enable && pnpm dlx @jcwillox/semantic-release-config
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEMANTIC_RELEASE_GITHUB_DRAFT: ${{ inputs.draft }}
SEMANTIC_RELEASE_FORCE_RELEASE: ${{ inputs.release_type }}
SEMANTIC_RELEASE_CHANGELOG_FILE: "${{ env.TARGET }}/CHANGELOG.md"
SEMANTIC_RELEASE_CMD_PREPARE: "yq -i '.version = \"${nextRelease.version}\"' ${{ env.TARGET }}/config.yaml"
SEMANTIC_RELEASE_GIT_ASSETS: '["${{ env.TARGET }}/CHANGELOG.md", "${{ env.TARGET }}/config.yaml"]'
SEMANTIC_RELEASE_GIT_MESSAGE: "release: ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
53 changes: 0 additions & 53 deletions .github/workflows/release.yml

This file was deleted.

File renamed without changes.
31 changes: 18 additions & 13 deletions rclone_backup/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
## What’s changed

## What's Changed

* build(deps): update actions/checkout action to v4 by @renovate in https://github.com/jcwillox/hassio-rclone-backup/pull/62
* build(deps): update docker/login-action action to v3 by @renovate in https://github.com/jcwillox/hassio-rclone-backup/pull/63
* build(deps): update all non-major dependencies by @renovate in https://github.com/jcwillox/hassio-rclone-backup/pull/61
* updated to `rclone` to `v1.66.0`
* build(deps): update module github.com/go-co-op/gocron to v2 by @renovate in https://github.com/jcwillox/hassio-rclone-backup/pull/64
* build(deps): update go.mod version to 1.22 (dd73c29)
* ci: add renovate config (2bb7d50)

**Full Changelog**: https://github.com/jcwillox/hassio-rclone-backup/compare/3.1.0...3.2.0
# Changelog

## 3.2.0

### 📦 Build

* **deps:** Update actions/checkout action to v4 ([#62](https://github.com/jcwillox/hassio-rclone-backup/pull/62))
* **deps:** Update docker/login-action action to v3 ([#63](https://github.com/jcwillox/hassio-rclone-backup/pull/63))
* **deps:** Update all non-major dependencies ([#61](https://github.com/jcwillox/hassio-rclone-backup/pull/61))
* updated to `rclone` to `v1.66.0`
* **deps:** Update module github.com/go-co-op/gocron to v2 ([#64](https://github.com/jcwillox/hassio-rclone-backup/pull/64))
* **deps:** Update go.mod version to 1.22 ([dd73c29](https://github.com/jcwillox/hassio-rclone-backup/commit/dd73c2914c96c95aaa0d1262492d5caa1bf3fc39))

### ⚙️ Continuous Integration

* Add renovate config ([2bb7d50](https://github.com/jcwillox/hassio-rclone-backup/commit/2bb7d50ec5202c565afe462fa87f7c478928d9ad))

**Full Changelog**: [`3.1.0...3.2.0`](https://github.com/jcwillox/hassio-rclone-backup/compare/3.1.0...3.2.0)

0 comments on commit 7118fb1

Please sign in to comment.