Fix build number not the same

This commit is contained in:
SebClem 2024-08-26 16:06:32 +02:00
parent c8a0864fdd
commit eef0bbf78a
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50
2 changed files with 54 additions and 60 deletions

View File

@ -158,3 +158,57 @@ jobs:
cache-to: type=inline
context: ./${{env.TARGET}}/
platforms: ${{ matrix.arch_value }}
publish-main:
name: Publish main
runs-on: ubuntu-latest
needs:
- build-dockers
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
path: "addon"
- name: Checkout Hass repo
uses: actions/checkout@v4
with:
repository: Sebclem/sebclem-hassio-addon-repository
path: "repository"
- name: Get branch names
id: branch-names
uses: tj-actions/branch-names@v8
- name: Generate readme
uses: cuchi/jinja2-action@v1.2.2
with:
template: addon/nextcloud_backup/.README.md.j2
output_file: repository/nextcloud_backup/README.md
variables: version=${{ steps.branch-names.outputs.current_branch }}.${{ github.run_number}}
- name: Move other files
run: |
cp addon/nextcloud_backup/DOCS.md repository/nextcloud_backup/
cp addon/nextcloud_backup/icon.png repository/nextcloud_backup/
cp addon/nextcloud_backup/logo.png repository/nextcloud_backup/
cp addon/nextcloud_backup/config.yml repository/nextcloud_backup/
- name: Change version in config file
uses: fjogeleit/yaml-update-action@main
with:
valueFile: 'repository/nextcloud_backup/config.yml'
propertyPath: 'version'
value: ${{ steps.branch-names.outputs.current_branch }}.${{ github.run_number}}
commitChange: false
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT_PR }}
path: "repository"
commit-message: "Update Nextcloud Backup to ${{ steps.branch-names.outputs.current_branch }}.${{ github.run_number }}"
branch: "update/bextcloud_backup/${{ steps.branch-names.outputs.current_branch }}.${{ github.run_number }}"
base: "${{ steps.branch-names.outputs.current_branch }}"
title: "Update Nextcloud Backup to ${{ steps.branch-names.outputs.current_branch }}.${{ github.run_number }}"

View File

@ -1,60 +0,0 @@
name: Update repository
on:
release:
types: [published]
push:
branches: main
workflow_dispatch:
jobs:
publish-main:
name: Publish main
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
path: "addon"
- name: Checkout Hass repo
uses: actions/checkout@v4
with:
repository: Sebclem/sebclem-hassio-addon-repository
path: "repository"
- name: Get branch names
id: branch-names
uses: tj-actions/branch-names@v8
- name: Generate readme
uses: cuchi/jinja2-action@v1.2.2
with:
template: addon/nextcloud_backup/.README.md.j2
output_file: repository/nextcloud_backup/README.md
variables: version=${{ steps.branch-names.outputs.current_branch }}.${{ github.run_id}}
- name: Move other files
run: |
cp addon/nextcloud_backup/DOCS.md repository/nextcloud_backup/
cp addon/nextcloud_backup/icon.png repository/nextcloud_backup/
cp addon/nextcloud_backup/logo.png repository/nextcloud_backup/
cp addon/nextcloud_backup/config.yml repository/nextcloud_backup/
- name: Change version in config file
uses: fjogeleit/yaml-update-action@main
with:
valueFile: 'repository/nextcloud_backup/config.yml'
propertyPath: 'version'
value: ${{ steps.branch-names.outputs.current_branch }}.${{ github.run_number}}
commitChange: false
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT_PR }}
path: "repository"
commit-message: "Update Nextcloud Backup to ${{ steps.branch-names.outputs.current_branch }}.${{ github.run_number }}"
branch: "update/bextcloud_backup/${{ steps.branch-names.outputs.current_branch }}.${{ github.run_number }}"
base: "${{ steps.branch-names.outputs.current_branch }}"
title: "Update Nextcloud Backup to ${{ steps.branch-names.outputs.current_branch }}.${{ github.run_number }}"