-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤹 ci (actions): Manage multiple addons in the same repository - first…
… commit
- Loading branch information
Showing
4 changed files
with
67 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,42 +25,54 @@ jobs: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: ✍🏼 version SambaNAs | ||
- name: 📽️ Extract dev branch project name | ||
shell: bash | ||
run: echo "name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/devrelease/}}" >> $GITHUB_OUTPUT | ||
id: extract_project | ||
|
||
- name: ✍🏼 version ${{ steps.extract_project.outputs.name }} | ||
id: version_get | ||
uses: endaft/[email protected] | ||
with: | ||
file: ./${{ steps.extract_project.outputs.name }}/config.yaml | ||
path: version | ||
get: true | ||
|
||
- name: 📽️ Identify SemVer ${{ steps.version_get.outputs.value_old }} suffix | ||
shell: bash | ||
run: echo "suffix=${{ contains(steps.version_get.outputs.value_old,'-') && '.' || '-' }}" >> $GITHUB_OUTPUT | ||
id: semver-suffix | ||
|
||
- name: ✍🏼 version ${{ steps.extract_project.outputs.name }} | ||
id: version_set | ||
uses: endaft/[email protected] | ||
with: | ||
file: ./sambanas/config.yaml | ||
file: ./${{ steps.extract_project.outputs.name }}/config.yaml | ||
path: version | ||
set: .dev${{ github.run_number }} | ||
set: ${{ steps.semver-suffix.outputs.suffix }}dev${{ github.run_number }} | ||
get: true | ||
append: true | ||
|
||
|
||
- name: Publish SambaNAS Addon ${{ steps.version_set.outputs.value_old }} | ||
- name: 📰 Publish ${{ steps.extract_project.outputs.name }} Addon ${{ steps.version_set.outputs.value_old }} | ||
uses: home-assistant/builder@master | ||
env: | ||
CAS_API_KEY: ${{ secrets.CAS_API_KEY }} | ||
with: | ||
args: | | ||
--aarch64 \ | ||
--target sambanas \ | ||
--target ${{ steps.extract_project.outputs.name }} \ | ||
--docker-hub dianlight | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "BR_VERSION=${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT" | ||
id: extract_branch | ||
|
||
- name: pull-request | ||
- name: 🧑🏽💻 pull-request | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
continue-on-error: true | ||
shell: bash | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Prerelease Bot" | ||
git branch -f "prerelease/${{ steps.extract_branch.outputs.BR_VERSION }}_${{ steps.version_set.outputs.value_old }}" HEAD | ||
git push -u origin "prerelease/${{ steps.extract_branch.outputs.BR_VERSION }}_${{ steps.version_set.outputs.value_old }}" || : | ||
git branch -f "prerelease/${{ steps.extract_project.outputs.name }}_${{ steps.version_set.outputs.value_old }}" HEAD | ||
git push -u origin "prerelease/${{ steps.extract_project.outputs.name }}_${{ steps.version_set.outputs.value_old }}" || : | ||
git restore . | ||
git clean -f | ||
gh pr create --base "prerelease/${{ steps.extract_branch.outputs.BR_VERSION }}_${{ steps.version_set.outputs.value_old }}" --title "Releasing ${{ github.ref }} into prerelease" --body ":crown: *An automated PR*" | ||
gh pr create --base "prerelease/${{ steps.extract_project.outputs.name }}_${{ steps.version_set.outputs.value_old }}" --title "Releasing ${{ github.ref }} into prerelease" --body ":crown: *An automated PR*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,34 +24,55 @@ jobs: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: ✍🏼 version SambaNAs | ||
- name: 📽️ Extract dev branch project name | ||
shell: bash | ||
run: | | ||
FULL_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/devrelease/}}" | ||
echo "full_name=${FULL_NAME} >> $GITHUB_OUTPUT | ||
echo "name=${FULL_NAME%%_*}" >> $GITHUB_OUTPUT | ||
id: extract_project | ||
|
||
- name: ✍🏼 version ${{ steps.extract_project.outputs.name }} | ||
id: version_get | ||
uses: endaft/[email protected] | ||
with: | ||
file: ./${{ steps.extract_project.outputs.name }}/config.yaml | ||
path: version | ||
get: true | ||
|
||
- name: 📽️ Identify SemVer ${{ steps.version_get.outputs.value_old }} suffix | ||
shell: bash | ||
run: echo "suffix=${{ contains(steps.version_get.outputs.value_old,'-') && '.' || '-' }}" >> $GITHUB_OUTPUT | ||
id: semver-suffix | ||
|
||
- name: ✍🏼 version ${{ steps.extract_project.outputs.name }} | ||
id: version_set | ||
uses: endaft/[email protected] | ||
with: | ||
file: ./sambanas/config.yaml | ||
file: ./${{ steps.extract_project.outputs.name }}/config.yaml | ||
path: version | ||
set: .beta${{ github.run_number }} | ||
set: ${{ steps.semver-suffix.outputs.suffix }}beta${{ github.run_number }} | ||
get: true | ||
append: true | ||
|
||
- name: ✍🏼 BetaName SambaNAs | ||
- name: ✍🏼 BetaName ${{ steps.extract_project.outputs.name }} | ||
id: betaname_set | ||
uses: endaft/[email protected] | ||
with: | ||
file: ./sambanas/config.yaml | ||
file: ./${{ steps.extract_project.outputs.name }}/config.yaml | ||
path: name | ||
set: -β | ||
get: true | ||
append: true | ||
|
||
- name: Publish SambaNAS Addon ${{ steps.version_set.outputs.value_new }} | ||
- name: Publish ${{ steps.extract_project.outputs.name }} Addon ${{ steps.version_set.outputs.value_new }} | ||
uses: home-assistant/builder@master | ||
env: | ||
CAS_API_KEY: ${{ secrets.CAS_API_KEY }} | ||
with: | ||
args: | | ||
--all \ | ||
--target sambanas \ | ||
--target ${{ steps.extract_project.outputs.name }} \ | ||
--docker-hub dianlight | ||
- name: Create pull request for Beta Repository | ||
|
@@ -63,7 +84,7 @@ jobs: | |
git_config_user_email: '[email protected]' | ||
git_config_user_name: 'ffp-bot' | ||
target_repo: 'dianlight/hassio-addons-beta' | ||
source_dir: 'sambanas' | ||
source_dir: '${{ steps.extract_project.outputs.name }}' | ||
# source_dir_copy_glob: '!(*.yaml)' | ||
target_dir: '' | ||
pr_target_repo_base_branch: 'master' | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters