diff --git a/.dockerignore b/.dockerignore index f2f90ab..ae30b96 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,6 +16,11 @@ app/pkg/* Dockerfile .dockerignore +# Don't track docs +README.md +LICENSE +docs/* + # Various config files that shouldn't be tracked lldap_config.toml server_key diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5737055 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# Set update schedule for GitHub Actions + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every weekday + interval: "daily" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cd335b7..83f7ca0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,11 +1,12 @@ -name: ci +name: docker on: push: branches: - 'main' - tags: - - 'v*.*.*' + release: + types: + - 'published' pull_request: branches: - 'main' @@ -43,8 +44,14 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + + # Parse the tag into semver. + - uses: gacts/github-slug@v1 + id: slug + - name: Build and push + if: github.event_name != 'release' uses: docker/build-push-action@v2 with: context: . @@ -53,6 +60,20 @@ jobs: tags: nitnelave/lldap:latest cache-from: type=gha cache-to: type=gha,mode=max + + - + name: Build and push + if: github.event_name == 'release' + uses: docker/build-push-action@v2 + with: + context: . + push: true + platforms: linux/amd64 + # Tag as latest, stable, semver, major, major.minor and major.minor.patch. + tags: nitnelave/lldap:latest, nitnelave/lldap:stable, nitnelave/lldap:v${{ steps.slug.outputs.version-semantic }}, nitnelave/lldap:v${{ steps.slug.outputs.version-major }}, nitnelave/lldap:v${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}, nitnelave/lldap:v${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}.${{ steps.slug.outputs.version-patch }} + cache-from: type=gha + cache-to: type=gha,mode=max + - name: Update repo description if: github.event_name != 'pull_request' diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f575bc8..e848017 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,8 +10,25 @@ env: CARGO_TERM_COLOR: always jobs: + pre_job: + # continue-on-error: true # Uncomment once integration is finished + runs-on: ubuntu-latest + # Map a step output to a job output + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@master + with: + # All of these options are optional, so you can remove them if you are happy with the defaults + concurrent_skipping: 'never' + skip_after_successful_duplicate: 'true' + paths_ignore: '["**/README.md", "**/docs/**"]' + do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' test: name: cargo test + needs: pre_job + if: ${{ needs.pre_job.outputs.should_skip != 'true' }} runs-on: ubuntu-latest steps: @@ -30,6 +47,8 @@ jobs: clippy: name: cargo clippy + needs: pre_job + if: ${{ needs.pre_job.outputs.should_skip != 'true' }} runs-on: ubuntu-latest steps: - name: Checkout sources @@ -53,6 +72,8 @@ jobs: format: name: cargo fmt + needs: pre_job + if: ${{ needs.pre_job.outputs.should_skip != 'true' }} runs-on: ubuntu-latest steps: - name: Checkout sources @@ -76,6 +97,8 @@ jobs: coverage: name: Code coverage + needs: pre_job + if: ${{ needs.pre_job.outputs.should_skip != 'true' }} runs-on: ubuntu-latest steps: - name: Checkout sources @@ -96,7 +119,7 @@ jobs: - name: Aggregate reports run: cargo llvm-cov --no-run --lcov --output-path lcov.info - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v2.1.0 with: files: lcov.info fail_ci_if_error: true diff --git a/README.md b/README.md index 9f3a681..439e4be 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ volumes: services: lldap: - image: nitnelave/lldap + image: nitnelave/lldap:stable # Change this to the user:group you want. user: "33:33" ports: diff --git a/app/Cargo.toml b/app/Cargo.toml index df2a51b..6dd3ddd 100644 --- a/app/Cargo.toml +++ b/app/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "lldap_app" -version = "0.2.0" -authors = ["Valentin Tolmer ", "Steve Barrau ", "Thomas Wickham "] +version = "0.3.0-alpha.1" +authors = ["Valentin Tolmer "] edition = "2021" [dependencies] diff --git a/auth/Cargo.toml b/auth/Cargo.toml index 7fa7a5a..63a2608 100644 --- a/auth/Cargo.toml +++ b/auth/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "lldap_auth" -version = "0.2.0" -authors = ["Valentin Tolmer ", "Steve Barrau ", "Thomas Wickham "] +version = "0.3.0-alpha.1" +authors = ["Valentin Tolmer "] edition = "2021" [features] diff --git a/architecture.md b/docs/architecture.md similarity index 100% rename from architecture.md rename to docs/architecture.md diff --git a/server/Cargo.toml b/server/Cargo.toml index d004f39..6efbf12 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,8 +1,8 @@ [package] -authors = ["Valentin Tolmer ", "Steve Barrau ", "Thomas Wickham "] +authors = ["Valentin Tolmer "] edition = "2021" name = "lldap" -version = "0.2.0" +version = "0.3.0-alpha.1" [dependencies] actix = "0.12"