-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 858efe7
Showing
32 changed files
with
8,846 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,6 @@ | ||
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
# Ignore build and test binaries. | ||
bin/ | ||
target/ | ||
Dockerfile | ||
Makefile |
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,108 @@ | ||
name: Build and Test | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "v*" | ||
pull_request: | ||
branches: | ||
- "main" | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Lint | ||
run: | | ||
cargo clippy -- --no-deps | ||
- name: Test | ||
run: | | ||
cargo test | ||
build: | ||
needs: | ||
- check | ||
strategy: | ||
matrix: | ||
arch: ["x86_64", "aarch64"] | ||
runs-on: ubuntu-latest | ||
if: startswith(github.ref, 'refs/tags/v') # Only run on tag push | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: goto-bus-stop/setup-zig@v2 | ||
|
||
- name: Add musl targets | ||
run: | | ||
rustup target add ${{ matrix.arch }}-unknown-linux-musl | ||
- name: Install cargo-zigbuild | ||
run: | | ||
cargo install cargo-zigbuild | ||
- name: Build | ||
run: | | ||
cargo zigbuild --release --target ${{matrix.arch}}-unknown-linux-musl | ||
- name: Store artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wasmcloud-operator-${{matrix.arch}} | ||
path: target/${{matrix.arch}}-unknown-linux-musl/release/wasmcloud-operator | ||
|
||
release: | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
if: startswith(github.ref, 'refs/tags/v') # Only run on tag push | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=sha,prefix= | ||
type=semver,pattern={{version}} | ||
- name: Load artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
merge-multiple: true | ||
|
||
- name: Fix permissions and architectures | ||
run: | | ||
ls -l artifacts/wasmcloud-operator/ | ||
ls -l | ||
chmod +x artifacts/wasmcloud-operator/wasmcloud* | ||
mv artifacts/wasmcloud-operator/wasmcloud-operator-x86_64 artifacts/wasmcloud-operator-amd64 | ||
mv artifacts/wasmcloud-operator/wasmcloud-operator-aarch64 artifacts/wasmcloud-operator-arm64 | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 | ||
build-args: | ||
"BIN_PATH=artifacts/wasmcloud-operator" |
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,10 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
debug/ | ||
target/ | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb |
Oops, something went wrong.