|
1 | 1 | name: Publish to crates.io |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - tags: |
6 | | - # Only on SemVer tags like "7.3.0". |
7 | | - # Push a new tag to make a new release. |
8 | | - # It should match the version in Cargo.toml |
9 | | - # (Perhaps we could add a check for this?) |
10 | | - - '[0-9]+.[0-9]+.[0-9]+' |
| 4 | + push: |
| 5 | + tags: |
| 6 | + # Only on SemVer tags like "7.3.0". |
| 7 | + # Push a new tag to make a new release. |
| 8 | + # It should match the version in Cargo.toml |
| 9 | + # (Perhaps we could add a check for this?) |
| 10 | + - "[0-9]+.[0-9]+.[0-9]+" |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - build: |
14 | | - runs-on: ubuntu-latest |
| 13 | + build: |
| 14 | + runs-on: ubuntu-latest |
15 | 15 |
|
16 | | - services: |
17 | | - ldap: |
18 | | - image: openidentityplatform/opendj |
19 | | - ports: |
20 | | - - 1389:1389 |
21 | | - options: > |
22 | | - --env ROOT_USER_DN="cn=manager" |
| 16 | + services: |
| 17 | + ldap: |
| 18 | + image: openidentityplatform/opendj |
| 19 | + ports: |
| 20 | + - 1389:1389 |
| 21 | + options: > |
| 22 | + --env ROOT_USER_DN="cn=manager" |
23 | 23 |
|
24 | | - steps: |
25 | | - - name: Checkout code |
26 | | - uses: actions/checkout@v3 |
| 24 | + steps: |
| 25 | + - name: Checkout code |
| 26 | + uses: actions/checkout@v3 |
27 | 27 |
|
28 | | - - name: Get LDAP container ID |
29 | | - id: ldap_container_id |
30 | | - run: echo "LDAP_CONTAINER_ID=$(docker ps --filter 'ancestor=openidentityplatform/opendj:latest' -q)" >> $GITHUB_ENV |
| 28 | + - name: Get LDAP container ID |
| 29 | + id: ldap_container_id |
| 30 | + run: echo "LDAP_CONTAINER_ID=$(docker ps --filter 'ancestor=openidentityplatform/opendj:latest' -q)" >> $GITHUB_ENV |
31 | 31 |
|
32 | | - - name: Copy LDIF to LDAP container |
33 | | - run: docker cp ./data/data.ldif ${{ env.LDAP_CONTAINER_ID }}:/tmp/data.ldif |
| 32 | + - name: Copy LDIF to LDAP container |
| 33 | + run: docker cp ./data/data.ldif ${{ env.LDAP_CONTAINER_ID }}:/tmp/data.ldif |
34 | 34 |
|
35 | | - - name: Import LDIF into OpenDJ |
36 | | - run: | |
37 | | - docker exec ${{ job.services.ldap.id }} \ |
38 | | - /opt/opendj/bin/ldapmodify -h localhost -p 1389 -D "cn=manager" -w password -a -f /tmp/data.ldif |
| 35 | + - name: Import LDIF into OpenDJ |
| 36 | + run: | |
| 37 | + docker exec ${{ job.services.ldap.id }} \ |
| 38 | + /opt/opendj/bin/ldapmodify -h localhost -p 1389 -D "cn=manager" -w password -a -f /tmp/data.ldif |
39 | 39 |
|
40 | | - # Step 3: Install Rust |
41 | | - - name: Set up Rust |
42 | | - uses: actions-rs/toolchain@v1 |
43 | | - with: |
44 | | - toolchain: stable |
45 | | - profile: minimal |
| 40 | + # Step 3: Install Rust |
| 41 | + - name: Set up Rust |
| 42 | + uses: actions-rs/toolchain@v1 |
| 43 | + with: |
| 44 | + toolchain: stable |
| 45 | + profile: minimal |
46 | 46 |
|
47 | | - # Step 4: Build the Rust project |
48 | | - - name: Build |
49 | | - run: cargo build --verbose |
| 47 | + # Step 4: Build the Rust project |
| 48 | + - name: Build |
| 49 | + run: cargo build --verbose |
50 | 50 |
|
51 | | - # Step 5: Run unit tests |
52 | | - - name: Run tests |
53 | | - run: cargo test --verbose |
| 51 | + # Step 5: Run unit tests |
| 52 | + - name: Run tests |
| 53 | + run: cargo test --verbose |
54 | 54 |
|
55 | | - # Check that there are no SemVer violations before releasing. |
56 | | - # https://github.com/obi1kenobi/cargo-semver-checks |
57 | | - - name: Check semver |
58 | | - uses: obi1kenobi/cargo-semver-checks-action@v2 |
59 | | - with: |
60 | | - feature-group: default-features |
61 | | - features: pool |
| 55 | + # Check that there are no SemVer violations before releasing. |
| 56 | + # https://github.com/obi1kenobi/cargo-semver-checks |
| 57 | + - name: Check semver |
| 58 | + uses: obi1kenobi/cargo-semver-checks-action@v2 |
| 59 | + with: |
| 60 | + feature-group: default-features |
| 61 | + features: pool |
62 | 62 |
|
63 | | - # Another check with the mutually exclusive tls-rustls feature enabled. |
64 | | - - name: Check semver |
65 | | - uses: obi1kenobi/cargo-semver-checks-action@v2 |
66 | | - with: |
67 | | - feature-group: only-explicit-features |
68 | | - features: tls-rustls,pool |
| 63 | + # Another check with the mutually exclusive tls-rustls feature enabled. |
| 64 | + - name: Check semver |
| 65 | + uses: obi1kenobi/cargo-semver-checks-action@v2 |
| 66 | + with: |
| 67 | + feature-group: only-explicit-features |
| 68 | + features: tls-rustls,pool |
69 | 69 |
|
70 | | - |
71 | | - - name: Deploy to crates.io |
72 | | - if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
73 | | - run: cargo publish |
74 | | - env: |
75 | | - CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }} |
| 70 | + - name: Deploy to crates.io |
| 71 | + run: cargo publish |
| 72 | + env: |
| 73 | + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }} |
0 commit comments