From f152a78cb66a77629aa22249e5934c0aa708a71a Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Mon, 29 Nov 2021 09:37:05 +0100 Subject: [PATCH 1/7] github: add dependabot for checking actions versions --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml 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" From 2bbfacf7551b6c0e7b7d1be7b4355a443c9d0fe0 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Mon, 29 Nov 2021 09:37:47 +0100 Subject: [PATCH 2/7] workflows: Don't run Rust workflow again for same files --- .github/workflows/rust.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f575bc8..1a663e7 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"]' + 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 From 842afac7ddc18648a30ac4d985df6409db5d9e1f Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Mon, 29 Nov 2021 09:38:51 +0100 Subject: [PATCH 3/7] workflows: Ignore changes to docs for actions --- .dockerignore | 5 +++++ .github/workflows/rust.yml | 2 +- architecture.md => docs/architecture.md | 0 3 files changed, 6 insertions(+), 1 deletion(-) rename architecture.md => docs/architecture.md (100%) 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/workflows/rust.yml b/.github/workflows/rust.yml index 1a663e7..3ebd143 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -23,7 +23,7 @@ jobs: # 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"]' + paths_ignore: '["**/README.md", "**/docs/**"]' do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' test: name: cargo test diff --git a/architecture.md b/docs/architecture.md similarity index 100% rename from architecture.md rename to docs/architecture.md From 68013c8919fee5f523d0b24cc3a2b07b7de46421 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Mon, 29 Nov 2021 09:41:47 +0100 Subject: [PATCH 4/7] docker: Create a tagged image on release --- .github/workflows/docker.yml | 26 +++++++++++++++++++++++--- README.md | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cd335b7..505dca1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,11 +1,11 @@ -name: ci +name: docker on: push: branches: - 'main' - tags: - - 'v*.*.*' + release: + types: [created] pull_request: branches: - 'main' @@ -43,8 +43,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 +59,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/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: From e44625bc6a95d6021203d7c80f8b946b59429165 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Nov 2021 08:55:20 +0000 Subject: [PATCH 5/7] build(deps): bump codecov/codecov-action from 1 to 2.1.0 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1 to 2.1.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v1...v2.1.0) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3ebd143..e848017 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -119,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 From 9d623e59c145935dc59524b3389c8f78cd0bdf46 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Mon, 29 Nov 2021 10:23:52 +0100 Subject: [PATCH 6/7] docker: Add release as a workflow trigger --- .github/workflows/docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 505dca1..83f7ca0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,7 +5,8 @@ on: branches: - 'main' release: - types: [created] + types: + - 'published' pull_request: branches: - 'main' From ddeb4c3ce38f45ff23e3e3bb86429a54b32331b3 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Mon, 29 Nov 2021 10:26:11 +0100 Subject: [PATCH 7/7] cargo: Bump the version number to 0.3.0-alpha.1 --- app/Cargo.toml | 4 ++-- auth/Cargo.toml | 4 ++-- server/Cargo.toml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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/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"