Skip to content

Commit

Permalink
feat!: Drop WASM target, add Docker
Browse files Browse the repository at this point in the history
This removes WASM (and as a result cloudflare) as the deployment target.
Instead this builds a docker container to deploy anywhere.

Tokio now takes care of the async runtime, flushing of OTLP is handled
by a background task, every second, instead of every request.

The list-package endpoint's `href`'s will now use relative paths, not
sure how I missed this was an option.
  • Loading branch information
AllexVeldman committed Sep 27, 2024
1 parent c5a509f commit a4519a6
Show file tree
Hide file tree
Showing 25 changed files with 400 additions and 714 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
build/
target/
62 changes: 62 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish

on:
push:
tags:
- '*'
branches:
- main
pull_request:

concurrency:
# Cancel existing runs when pushing to the same branch of a PR
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read
packages: write

jobs:
build:
runs-on: ubuntu-latest
name: Build
timeout-minutes: 15

steps:
- uses: actions/checkout@v4
- uses: docker/metadata-action@v5
name: Docker meta
id: meta
with:
images: |
ghcr.io/allexveldman/pyoci
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./
file: docker/Dockerfile
cache-from: type=registry,ref=ghcr.io/allexveldman/pyoci:latest
cache-to: type=inline
push: true # ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
6 changes: 0 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build
run: just build

- name: Test
run: just test-coverage

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ build/
node_modules/
.venv/
lcov.info
.envrc
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ repos:
pass_filenames: false
language: system
entry: |
cargo clippy --target wasm32-unknown-unknown -- -D warnings
cargo clippy -- -D warnings
Loading

0 comments on commit a4519a6

Please sign in to comment.