-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply updated repository structure & CI workflow (#89)
- Loading branch information
Showing
7 changed files
with
1,931 additions
and
25 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
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 |
---|---|---|
|
@@ -132,13 +132,17 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
path: /tmp/.docker-cache | ||
key: docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha }} | ||
key: | ||
docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha | ||
}} | ||
restore-keys: | | ||
docker-${{ github.ref }}-${{ matrix.architecture }} | ||
- name: 🏗 Set up QEMU | ||
uses: docker/[email protected] | ||
- name: 🏗 Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: 🏗 Set up CodeNotary | ||
run: bash <(curl https://getvcn.codenotary.com -L) | ||
- name: ℹ️ Compose build flags | ||
id: flags | ||
run: | | ||
|
@@ -160,6 +164,19 @@ jobs: | |
echo "::error ::Could not determine platform for architecture ${{ matrix.architecture }}" | ||
exit 1 | ||
fi | ||
- name: ⤵️ Download base image | ||
run: docker pull "${{ steps.flags.outputs.from }}" | ||
- name: ✅ Verify authenticity of base image | ||
run: | | ||
vcn authenticate \ | ||
"docker://${{ steps.flags.outputs.from }}" | ||
vcn authenticate \ | ||
--output json \ | ||
--signerID 0x03e406879fd89e52f38f4aab0061266d1183980a \ | ||
"docker://${{ steps.flags.outputs.from }}" \ | ||
| jq \ | ||
--exit-status \ | ||
'.verification.status == 0' | ||
- name: 🚀 Build | ||
uses: docker/[email protected] | ||
with: | ||
|
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 |
---|---|---|
|
@@ -64,20 +64,28 @@ jobs: | |
matrix: | ||
architecture: ${{ fromJson(needs.information.outputs.architectures) }} | ||
steps: | ||
- name: 🔂 Wait for other runs to complete | ||
uses: softprops/turnstyle@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: 🏗 Set up build cache | ||
id: cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /tmp/.docker-cache | ||
key: docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha }} | ||
key: | ||
docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha | ||
}} | ||
restore-keys: | | ||
docker-${{ github.ref }}-${{ matrix.architecture }} | ||
- name: 🏗 Set up QEMU | ||
uses: docker/[email protected] | ||
- name: 🏗 Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: 🏗 Set up CodeNotary | ||
run: bash <(curl https://getvcn.codenotary.com -L) | ||
- name: ℹ️ Compose build flags | ||
id: flags | ||
run: | | ||
|
@@ -103,12 +111,25 @@ jobs: | |
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USERNAME }} | ||
password: ${{ secrets.GHCR_PASSWORD }} | ||
- name: 🚀 Build and push | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: ⤵️ Download base image | ||
run: docker pull "${{ steps.flags.outputs.from }}" | ||
- name: ✅ Verify authenticity of base image | ||
run: | | ||
vcn authenticate \ | ||
"docker://${{ steps.flags.outputs.from }}" | ||
vcn authenticate \ | ||
--output json \ | ||
--signerID 0x03e406879fd89e52f38f4aab0061266d1183980a \ | ||
"docker://${{ steps.flags.outputs.from }}" \ | ||
| jq \ | ||
--exit-status \ | ||
'.verification.status == 0' | ||
- name: 🚀 Build | ||
uses: docker/[email protected] | ||
with: | ||
push: true | ||
load: true | ||
# yamllint disable rule:line-length | ||
tags: | | ||
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }} | ||
|
@@ -130,6 +151,33 @@ jobs: | |
BUILD_REF=${{ github.sha }} | ||
BUILD_REPOSITORY=${{ github.repository }} | ||
BUILD_VERSION=${{ needs.information.outputs.version }} | ||
- name: 🔏 Notarize | ||
# yamllint disable rule:line-length | ||
run: | | ||
if vcn authenticate \ | ||
--output json \ | ||
"docker://ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}" \ | ||
| jq \ | ||
--exit-status \ | ||
'.verification.status != 0'; | ||
then | ||
vcn login | ||
vcn notarize \ | ||
--public \ | ||
"docker://ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}" | ||
fi | ||
env: | ||
VCN_USER: ${{ secrets.VCN_USER }} | ||
VCN_PASSWORD: ${{ secrets.VCN_PASSWORD }} | ||
VCN_NOTARIZATION_PASSWORD: ${{ secrets.VCN_NOTARIZATION_PASSWORD }} | ||
VCN_OTP_EMPTY: true | ||
- name: 🚀 Push | ||
# yamllint disable rule:line-length | ||
run: | | ||
docker push \ | ||
"ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}" | ||
docker push \ | ||
"ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}" | ||
publish-edge: | ||
name: 📢 Publish to edge repository | ||
|
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,21 @@ | ||
--- | ||
name: PR Labels | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
pull_request: | ||
types: [opened, labeled, unlabeled, synchronize] | ||
|
||
jobs: | ||
pr_labels: | ||
name: Verify | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🏷 Verify PR has a valid label | ||
uses: jesusvasquez333/[email protected] | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
valid-labels: >- | ||
breaking-change, bugfix, documentation, enhancement, refactor, | ||
performance, new-feature, maintenance, ci, dependencies | ||
disable-reviews: true |