mirror of
https://github.com/hassio-addons/addon-vscode.git
synced 2025-05-03 18:51:23 +00:00
Apply updated repository structure & CI workflow (#246)
This commit is contained in:
parent
4e491ada0d
commit
be84d16030
7 changed files with 1932 additions and 26 deletions
|
@ -1,19 +0,0 @@
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
charset = utf-8
|
|
||||||
end_of_line = lf
|
|
||||||
indent_style = space
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
ident_size = 4
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
ident_size = 2
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|
||||||
[*.json]
|
|
||||||
ident_size = 2
|
|
||||||
|
|
||||||
[{.gitignore,.gitkeep,.editorconfig}]
|
|
||||||
ident_size = 2
|
|
0
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
0
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
1839
.github/SECURITY.md
vendored
Normal file
1839
.github/SECURITY.md
vendored
Normal file
File diff suppressed because it is too large
Load diff
21
.github/workflows/ci.yaml
vendored
21
.github/workflows/ci.yaml
vendored
|
@ -38,7 +38,7 @@ jobs:
|
||||||
- name: ⤵️ Check out code from GitHub
|
- name: ⤵️ Check out code from GitHub
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v2.3.4
|
||||||
- name: 🚀 Run Add-on Lint
|
- name: 🚀 Run Add-on Lint
|
||||||
uses: frenck/action-addon-linter@v2.1
|
uses: frenck/action-addon-linter@v2
|
||||||
with:
|
with:
|
||||||
community: true
|
community: true
|
||||||
path: "./${{ needs.information.outputs.target }}"
|
path: "./${{ needs.information.outputs.target }}"
|
||||||
|
@ -132,13 +132,17 @@ jobs:
|
||||||
uses: actions/cache@v2.1.5
|
uses: actions/cache@v2.1.5
|
||||||
with:
|
with:
|
||||||
path: /tmp/.docker-cache
|
path: /tmp/.docker-cache
|
||||||
key: docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha }}
|
key:
|
||||||
|
docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha
|
||||||
|
}}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
docker-${{ github.ref }}-${{ matrix.architecture }}
|
docker-${{ github.ref }}-${{ matrix.architecture }}
|
||||||
- name: 🏗 Set up QEMU
|
- name: 🏗 Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1.1.0
|
uses: docker/setup-qemu-action@v1.1.0
|
||||||
- name: 🏗 Set up Docker Buildx
|
- name: 🏗 Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1.3.0
|
uses: docker/setup-buildx-action@v1.3.0
|
||||||
|
- name: 🏗 Set up CodeNotary
|
||||||
|
run: bash <(curl https://getvcn.codenotary.com -L)
|
||||||
- name: ℹ️ Compose build flags
|
- name: ℹ️ Compose build flags
|
||||||
id: flags
|
id: flags
|
||||||
run: |
|
run: |
|
||||||
|
@ -160,6 +164,19 @@ jobs:
|
||||||
echo "::error ::Could not determine platform for architecture ${{ matrix.architecture }}"
|
echo "::error ::Could not determine platform for architecture ${{ matrix.architecture }}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
- name: 🚀 Build
|
||||||
uses: docker/build-push-action@v2.4.0
|
uses: docker/build-push-action@v2.4.0
|
||||||
with:
|
with:
|
||||||
|
|
58
.github/workflows/deploy.yaml
vendored
58
.github/workflows/deploy.yaml
vendored
|
@ -64,6 +64,10 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
architecture: ${{ fromJson(needs.information.outputs.architectures) }}
|
architecture: ${{ fromJson(needs.information.outputs.architectures) }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: 🔂 Wait for other runs to complete
|
||||||
|
uses: softprops/turnstyle@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: ⤵️ Check out code from GitHub
|
- name: ⤵️ Check out code from GitHub
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v2.3.4
|
||||||
- name: 🏗 Set up build cache
|
- name: 🏗 Set up build cache
|
||||||
|
@ -71,13 +75,17 @@ jobs:
|
||||||
uses: actions/cache@v2.1.5
|
uses: actions/cache@v2.1.5
|
||||||
with:
|
with:
|
||||||
path: /tmp/.docker-cache
|
path: /tmp/.docker-cache
|
||||||
key: docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha }}
|
key:
|
||||||
|
docker-${{ github.ref }}-${{ matrix.architecture }}-${{ github.sha
|
||||||
|
}}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
docker-${{ github.ref }}-${{ matrix.architecture }}
|
docker-${{ github.ref }}-${{ matrix.architecture }}
|
||||||
- name: 🏗 Set up QEMU
|
- name: 🏗 Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1.1.0
|
uses: docker/setup-qemu-action@v1.1.0
|
||||||
- name: 🏗 Set up Docker Buildx
|
- name: 🏗 Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1.3.0
|
uses: docker/setup-buildx-action@v1.3.0
|
||||||
|
- name: 🏗 Set up CodeNotary
|
||||||
|
run: bash <(curl https://getvcn.codenotary.com -L)
|
||||||
- name: ℹ️ Compose build flags
|
- name: ℹ️ Compose build flags
|
||||||
id: flags
|
id: flags
|
||||||
run: |
|
run: |
|
||||||
|
@ -103,12 +111,25 @@ jobs:
|
||||||
uses: docker/login-action@v1.9.0
|
uses: docker/login-action@v1.9.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.GHCR_USERNAME }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GHCR_PASSWORD }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: 🚀 Build and push
|
- 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/build-push-action@v2.4.0
|
uses: docker/build-push-action@v2.4.0
|
||||||
with:
|
with:
|
||||||
push: true
|
load: true
|
||||||
# yamllint disable rule:line-length
|
# yamllint disable rule:line-length
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}
|
ghcr.io/hassio-addons/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}
|
||||||
|
@ -130,6 +151,33 @@ jobs:
|
||||||
BUILD_REF=${{ github.sha }}
|
BUILD_REF=${{ github.sha }}
|
||||||
BUILD_REPOSITORY=${{ github.repository }}
|
BUILD_REPOSITORY=${{ github.repository }}
|
||||||
BUILD_VERSION=${{ needs.information.outputs.version }}
|
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:
|
publish-edge:
|
||||||
name: 📢 Publish to edge repository
|
name: 📢 Publish to edge repository
|
||||||
|
|
21
.github/workflows/pr-labels.yaml
vendored
Normal file
21
.github/workflows/pr-labels.yaml
vendored
Normal file
|
@ -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/verify-pr-label-action@v1.4.0
|
||||||
|
with:
|
||||||
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
valid-labels: >-
|
||||||
|
breaking-change, bugfix, documentation, enhancement, refactor,
|
||||||
|
performance, new-feature, maintenance, ci, dependencies
|
||||||
|
disable-reviews: true
|
Loading…
Add table
Add a link
Reference in a new issue