This repository has been archived by the owner on Nov 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update things to be in line with example * Update build.yaml * Use unified action workflows
- Loading branch information
Showing
12 changed files
with
61 additions
and
242 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,62 +6,7 @@ on: | |
tags: [v*] | ||
|
||
jobs: | ||
build: | ||
name: Build image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set add-on version | ||
run: | | ||
ADDON_VERSION=$( cut -c12- <<< ${{ github.ref }} ) | ||
sed -i "s/dev/$ADDON_VERSION/g" filiicodex/config.json | ||
- name: Build and push tagged Docker image | ||
uses: home-assistant/[email protected] | ||
with: | ||
args: | | ||
--all \ | ||
--target filiicodex \ | ||
--image "filiicodex/{arch}" \ | ||
--docker-hub "ghcr.io/filii-lamberti" | ||
publish: | ||
needs: build | ||
name: Publish release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout add-on code | ||
uses: actions/[email protected] | ||
with: | ||
persist-credentials: false | ||
path: addon | ||
- name: Checkout repository code | ||
uses: actions/[email protected] | ||
with: | ||
persist-credentials: false | ||
repository: filii-lamberti/repository | ||
path: repository | ||
- name: Create local changes and commit files | ||
continue-on-error: true | ||
run: | | ||
ADDON_NAME=$( cut -c22- <<< ${{ github.repository }} ) | ||
ADDON_VERSION=$( cut -c12- <<< ${{ github.ref }} ) | ||
cp -v addon/README.md addon/filiicodex/config.json repository/filiicodex/ | ||
cd repository | ||
sed -i "s/dev/$ADDON_VERSION/g" filiicodex/config.json | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Filii Lamberti" | ||
git add . | ||
git commit -m "Upgrade $ADDON_NAME to v$ADDON_VERSION" -a | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
directory: repository | ||
repository: filii-lamberti/repository | ||
continuous-deployment: | ||
uses: filii-lamberti/repository/.github/workflows/cd.yml@main | ||
with: | ||
addon: filiicodex |
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 |
---|---|---|
|
@@ -3,58 +3,12 @@ name: Continuous integration | |
on: | ||
push: | ||
# Sequence of patterns matched against refs/heads | ||
branches: [master] | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
lint: | ||
name: Lint code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
- name: Use Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: '14' | ||
cache: 'npm' | ||
cache-dependency-path: ./filiicodex/rootfs/opt/filiicodex/package-lock.json | ||
- name: Install ESLint and dependencies | ||
run: npm install | ||
working-directory: ./filiicodex/rootfs/opt/filiicodex | ||
- name: Run ESLint | ||
run: node_modules/eslint/bin/eslint.js index.js | ||
working-directory: ./filiicodex/rootfs/opt/filiicodex | ||
|
||
test: | ||
needs: lint | ||
name: Test code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set add-on version | ||
run: | | ||
sed -i "s/dev/latest/g" filiicodex/config.json | ||
- name: Build and push latest Docker image | ||
uses: home-assistant/[email protected] | ||
with: | ||
args: | | ||
--amd64 \ | ||
--target filiicodex \ | ||
--image "filiicodex/{arch}" \ | ||
--docker-hub "ghcr.io/filii-lamberti" | ||
update_release_draft: | ||
name: Release Drafter | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Drafts your next Release notes as Pull Requests are merged into "master" | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
continuous-integration: | ||
uses: filii-lamberti/repository/.github/workflows/ci.yml@main | ||
with: | ||
addon: filiicodex |
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 |
---|---|---|
@@ -1,14 +1,3 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
|
@@ -21,51 +10,5 @@ on: | |
- cron: '0 0 * * 0' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'javascript' ] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] | ||
# Learn more: | ||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 | ||
codeql-analysis: | ||
uses: filii-lamberti/repository/.github/workflows/codeql-analysis.yml@main |
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
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 |
---|---|---|
|
@@ -27,7 +27,6 @@ RUN \ | |
\ | ||
&& npm install --production \ | ||
\ | ||
&& npx mod-pruner init --force \ | ||
&& npx mod-pruner prune --force \ | ||
\ | ||
&& apk del --no-cache --purge .build-dependencies | ||
|
@@ -37,23 +36,28 @@ COPY rootfs/opt/filiicodex/index.js /opt/filiicodex/ | |
# Build arugments | ||
ARG BUILD_ARCH | ||
ARG BUILD_DATE | ||
ARG BUILD_DESCRIPTION | ||
ARG BUILD_NAME | ||
ARG BUILD_REF | ||
ARG BUILD_REPOSITORY | ||
ARG BUILD_VERSION | ||
|
||
# Labels | ||
LABEL \ | ||
io.hass.name="Filiicodex" \ | ||
io.hass.description="A Filiicodex add-on for Home Assistant" \ | ||
io.hass.name="${BUILD_NAME}" \ | ||
io.hass.description="${BUILD_DESCRIPTION}" \ | ||
io.hass.arch="${BUILD_ARCH}" \ | ||
io.hass.type="addon" \ | ||
io.hass.version=${BUILD_VERSION} \ | ||
maintainer="Jorim Tielemans <[email protected]>" \ | ||
org.label-schema.description="A Filiicodex add-on for Home Assistant" \ | ||
org.label-schema.build-date=${BUILD_DATE} \ | ||
org.label-schema.name="Filiicodex" \ | ||
org.label-schema.schema-version="1.0" \ | ||
org.label-schema.url="https://addons.community" \ | ||
org.label-schema.usage="https://gitlab.com/filii-lamberti/addon-filiicodex" \ | ||
org.label-schema.vcs-ref=${BUILD_REF} \ | ||
org.label-schema.vcs-url="https://gitlab.com/filii-lamberti/filii-addons" \ | ||
org.label-schema.vendor="Filii Lamberti" | ||
org.opencontainers.image.title="${BUILD_NAME}" \ | ||
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \ | ||
org.opencontainers.image.vendor="Filii Lamberti" \ | ||
org.opencontainers.image.authors="Jorim Tielemans <[email protected]>" \ | ||
org.opencontainers.image.licenses="MIT" \ | ||
org.opencontainers.image.url="https://github.com/filii-lamberti/filii-addons" \ | ||
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \ | ||
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \ | ||
org.opencontainers.image.created=${BUILD_DATE} \ | ||
org.opencontainers.image.revision=${BUILD_REF} \ | ||
org.opencontainers.image.version=${BUILD_VERSION} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
build_from: | ||
aarch64: ghcr.io/hassio-addons/base/aarch64:10.1.1 | ||
amd64: ghcr.io/hassio-addons/base/amd64:10.1.1 | ||
armhf: ghcr.io/hassio-addons/base/armhf:10.1.1 | ||
armv7: ghcr.io/hassio-addons/base/armv7:10.1.1 | ||
i386: ghcr.io/hassio-addons/base/i386:10.1.1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
name: Filiicodex | ||
version: dev | ||
slug: filiicodex | ||
description: A Filiicodex add-on for Home Assistant | ||
url: https://github.com/filii-lamberti/addon-filiicodex | ||
init: false | ||
arch: | ||
- aarch64 | ||
- amd64 | ||
- armhf | ||
- armv7 | ||
- i386 | ||
hassio_api: true | ||
homeassistant_api: true | ||
ports: | ||
3000/tcp: 8051 # C+O+D+E+X | ||
options: | ||
schema: | ||
purge: bool? | ||
logging: bool? | ||
debugging: bool? | ||
image: ghcr.io/filii-lamberti/filiicodex/{arch} |
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