This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(ci): add branch workflow * add cr and ct yaml files * remove linting until I can figure out whats wrong * move ci to devtools container * remote tty from in-docker * try install * not install * install proper golangci-lint path * add release workflow and fix failing lint * skip setting in dependencies for now
- Loading branch information
Showing
9 changed files
with
253 additions
and
19 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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Branch | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
container: | ||
name: Build and Test Container | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Devtools | ||
run: | | ||
make docker/devtools | ||
- name: Lint | ||
run: | | ||
make in-docker TARGETS="lint" | ||
- name: Test | ||
run: make in-docker TARGETS="test" | ||
|
||
- name: Distribute | ||
run: make in-docker TARGETS="dist" | ||
|
||
chart: | ||
name: Lint and Test Chart | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.4.1 | ||
|
||
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and | ||
# yamllint (https://github.com/adrienverge/yamllint) which require Python | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Set up chart-testing | ||
uses: helm/chart-testing-action@v2.0.1 | ||
with: | ||
version: v3.3.0 | ||
|
||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --config ct.yaml) | ||
if [[ -n "$changed" ]]; then | ||
echo "::set-output name=changed::true" | ||
fi | ||
- name: Run chart-testing (lint) | ||
run: ct lint --config ct.yaml --check-version-increment=false | ||
|
||
# TODO: turn back on | ||
|
||
# - name: Create kind cluster | ||
# uses: helm/kind-action@v1.1.0 | ||
# if: steps.list-changed.outputs.changed == 'true' | ||
|
||
# - name: Run chart-testing (install) | ||
# run: ct install --config ct.yaml |
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,135 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
distribute: | ||
name: Distribute Binaries and Containers | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Devtools | ||
run: | | ||
make docker/devtools | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to Registry | ||
run: echo "${REGISTRY_PASSWORD}" | docker login -u "${REGISTRY_USERNAME}" --password-stdin ghcr.io | ||
env: | ||
REGISTRY_USERNAME: ${{ secrets.GHCR_REGISTRY_USER }} | ||
REGISTRY_PASSWORD: ${{ secrets.GHCR_REGISTRY_PUSH_PASSWORD }} | ||
|
||
- name: Distribute Binaries | ||
run: | | ||
VERSION=${GITHUB_REF##*/v} make in-docker TARGETS="dist" | ||
- name: Distribute Container Image | ||
run: | | ||
VERSION=${GITHUB_REF##*/v} make release/docker | ||
chart: | ||
name: Publish Chart | ||
runs-on: ubuntu-latest | ||
|
||
needs: | ||
- container | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Prepare | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
mkdir .cr-index/ | ||
mkdir .cr-release-packages/ | ||
sudo apt-get install wget | ||
- name: Install yq | ||
env: | ||
VERSION: 4.9.7 | ||
run: | | ||
wget https://github.com/mikefarah/yq/releases/download/v${VERSION}/yq_linux_amd64 -O ./yq | ||
chmod +x ./yq | ||
sudo mv ./yq /usr/bin/yq | ||
- name: Install chart-releaser | ||
env: | ||
VERSION: 1.2.1 | ||
run: | | ||
wget https://github.com/helm/chart-releaser/releases/download/v${VERSION}/chart-releaser_${VERSION}_linux_amd64.tar.gz -O cr.tgz | ||
tar zxf cr.tgz cr && rm cr.tgz | ||
sudo mv ./cr /usr/bin/cr | ||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.4.1 | ||
|
||
- name: Set Versions | ||
shell: bash | ||
run: | | ||
export VERSION="\"${GITHUB_REF##*/v}\"" | ||
yq e ".version = ${VERSION}" -i ./charts/aetherfs-hub/Chart.yaml | ||
yq e ".appVersion = ${VERSION}" -i ./charts/aetherfs-hub/Chart.yaml | ||
yq e ".version = ${VERSION}" -i ./charts/aetherfs/Chart.yaml | ||
yq e ".appVersion = ${VERSION}" -i ./charts/aetherfs/Chart.yaml | ||
# TODO: Setup GPG signing | ||
# - name: Prepare GPG key | ||
# run: | | ||
# gpg_dir=.cr-gpg | ||
# mkdir "$gpg_dir" | ||
|
||
# keyring="$gpg_dir/secring.gpg" | ||
# base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring" | ||
|
||
# passphrase_file="$gpg_dir/passphrase" | ||
# echo "$GPG_PASSPHRASE" > "$passphrase_file" | ||
|
||
# echo "CR_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV" | ||
# echo "CR_KEYRING=$keyring" >> "$GITHUB_ENV" | ||
# env: | ||
# GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}" | ||
# GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}" | ||
|
||
# - name: Add dependency chart repos | ||
# run: | | ||
# helm repo add bitnami https://charts.bitnami.com/bitnami | ||
|
||
# package and upload manually | ||
# chart-releaser has some minor headaches when tags already exist at commit. | ||
- name: Package | ||
run: | | ||
cr package charts/aetherfs-hub | ||
cr package charts/aetherfs | ||
- name: Upload | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
.cr-release-packages/* | ||
- name: Index | ||
run: | | ||
cr index | ||
cp .cr-index/index.yaml docs/index.yaml | ||
git add docs/index.yaml | ||
git commit -m "release: charts" | ||
git push | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
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,3 +1,6 @@ | ||
.cr-release-packages/ | ||
.cr-index/ | ||
|
||
/charts/**/Chart.lock | ||
/charts/**/*.tgz | ||
/gen/ | ||
|
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
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,5 @@ | ||
charts-repo: https://aetherfs.tech/charts/ | ||
owner: mjpitz | ||
git-repo: aetherfs | ||
release-name-template: "v{{ .Version }}" | ||
pages-branch: "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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# See https://github.com/helm/chart-testing#configuration | ||
remote: origin | ||
chart-dirs: | ||
- charts | ||
helm-extra-args: --timeout 600s | ||
target-branch: main | ||
validate-maintainers: false |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ import ( | |
"net/http" | ||
) | ||
|
||
//nolint:typecheck | ||
//go:embed dist/* | ||
var assets embed.FS | ||
|
||
|