generated from crossplane/provider-template
-
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.
added Github Action for pack and store provider package in ghcr, and …
…generate magento types
- Loading branch information
1 parent
02ff1f5
commit 41c7316
Showing
2 changed files
with
101 additions
and
0 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,100 @@ | ||
name: Release builds | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build-and-pack: | ||
name: Build and pack | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: CR authentication | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Set VERSION env | ||
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: all | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
version: ${{ env.DOCKER_BUILDX_VERSION }} | ||
install: true | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Find the Go Build Cache | ||
id: go | ||
run: echo "::set-output name=cache::$(make go.cachedir)" | ||
|
||
- name: Cache the Go Build Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.go.outputs.cache }} | ||
key: ${{ runner.os }}-build-publish-artifacts-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-build-publish-artifacts- | ||
|
||
- name: Cache Go Dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .work/pkg | ||
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-pkg- | ||
|
||
- name: Vendor Dependencies | ||
run: make vendor vendor.check | ||
|
||
- name: Get make submodules | ||
run: make submodules | ||
|
||
- name: Process swagger.json | ||
run: | | ||
#!/bin/bash | ||
JSON_FILE="scheme.json" | ||
if [ ! -f "$JSON_FILE" ]; then | ||
echo "File $JSON_FILE does not exist." | ||
exit 1 | ||
fi | ||
path_keys=$(jq -r '.paths | keys[]' "$JSON_FILE" | grep -v '{') | ||
for path in $path_keys; do | ||
provider_name="magento.web7.md" | ||
version=$(echo "$path" | awk -F/ '{print $2}') | ||
type=$(echo "$path" | awk -F/ '{print $NF}') | ||
type=$(echo "${type^}") | ||
make provider.addtype provider=${provider_name} group=${version} kind=${type} | ||
done | ||
- name: Install crossplane CLI | ||
id: crossplane | ||
run: curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh" | sh | ||
|
||
- name: Build provider image | ||
run: docker build -t ${REGISTRY}/${{ github.repository }}/provider-magento:${{ env.VERSION }} ./cluster | ||
|
||
- name: Build and push crossplane packages | ||
run: ./crossplane xpkg build -f package -o provider-magento --embed-runtime-image ${REGISTRY}/${{ github.repository }}/provider-magento:${{ env.VERSION }} && ./crossplane xpkg push -f provider-magento ${REGISTRY}/${{ github.repository }}/provider-magento:${{ env.VERSION }} || true || true; |
Large diffs are not rendered by default.
Oops, something went wrong.