|
21 | 21 | name: Install Nix |
22 | 22 | uses: cachix/install-nix-action@v27 |
23 | 23 | with: |
24 | | - nix_path: nixpkgs=channel:nixos-24.05 |
| 24 | + nix_path: nixpkgs=channel:nixos-24.11 |
25 | 25 | - |
26 | 26 | name: Cargo cache |
27 | 27 | uses: actions/cache@v4 |
|
31 | 31 | ~/.cargo/registry/index/ |
32 | 32 | ~/.cargo/registry/cache/ |
33 | 33 | ~/.cargo/git/db/ |
34 | | - test-runner/target/ |
| 34 | + interface/target/ |
35 | 35 | key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} |
36 | 36 | - |
37 | 37 | name: Run tests |
38 | | - run: nix-shell --command "make nix-test" |
| 38 | + run: nix-shell --command "make test" |
| 39 | + |
| 40 | + dist: |
| 41 | + needs: tests |
| 42 | + runs-on: ubuntu-latest |
| 43 | + if: startsWith(github.ref, 'refs/tags/v') |
| 44 | + steps: |
| 45 | + - |
| 46 | + name: Checkout |
| 47 | + uses: actions/checkout@v4 |
| 48 | + - |
| 49 | + name: Install Nix |
| 50 | + uses: cachix/install-nix-action@v27 |
| 51 | + with: |
| 52 | + nix_path: nixpkgs=channel:nixos-24.11 |
| 53 | + - |
| 54 | + name: Cargo cache |
| 55 | + uses: actions/cache@v4 |
| 56 | + with: |
| 57 | + path: | |
| 58 | + ~/.cargo/bin/ |
| 59 | + ~/.cargo/registry/index/ |
| 60 | + ~/.cargo/registry/cache/ |
| 61 | + ~/.cargo/git/db/ |
| 62 | + interface/target/ |
| 63 | + key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} |
| 64 | + - |
| 65 | + name: Install dev dependencies |
| 66 | + run: nix-shell --command "make dev-dependencies" |
| 67 | + - |
| 68 | + name: Build |
| 69 | + run: nix-shell --command "make build" |
| 70 | + - |
| 71 | + name: Docker meta |
| 72 | + id: meta |
| 73 | + uses: docker/metadata-action@v3 |
| 74 | + with: |
| 75 | + images: | |
| 76 | + chirpstack/${{ github.event.repository.name }} |
| 77 | + tags: | |
| 78 | + type=semver,pattern={{version}} |
| 79 | + type=semver,pattern={{major}} |
| 80 | + type=semver,pattern={{major}}.{{minor}} |
| 81 | + - |
| 82 | + name: Set up QEMU |
| 83 | + uses: docker/setup-qemu-action@v1 |
| 84 | + - |
| 85 | + name: Set up Docker Buildx |
| 86 | + uses: docker/setup-buildx-action@v1 |
| 87 | + - |
| 88 | + name: Login to DockerHub |
| 89 | + uses: docker/login-action@v1 |
| 90 | + with: |
| 91 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 92 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 93 | + - |
| 94 | + name: Build and push |
| 95 | + id: docker_build |
| 96 | + uses: docker/build-push-action@v2 |
| 97 | + with: |
| 98 | + context: . |
| 99 | + push: ${{ startsWith(github.ref, 'refs/tags/v') }} |
| 100 | + platforms: linux/arm64 |
| 101 | + tags: ${{ steps.meta.outputs.tags }} |
| 102 | + labels: ${{ steps.meta.outputs.labels }} |
| 103 | + - |
| 104 | + name: Image digest |
| 105 | + run: echo ${{ steps.docker_build.outputs.digest }} |
0 commit comments