Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 37 additions & 12 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
branches:
- "develop"
- "main"
tags:
- "v*"
- "releases/**/*"
pull_request:
branches:
- "develop"
Expand Down Expand Up @@ -60,19 +59,34 @@ jobs:

outputs:
continue: ${{ steps.check.outputs.continue }}
type: ${{ steps.check.outputs.type }}
version: ${{ steps.check.outputs.version }}

steps:
- id: check
name: Check Context
run: |
if [[ "${{ github.repository }}" == "torrust/torrust-tracker" ]]; then
if [[ "${{ github.event_name }}" == "push" ]]; then
if [[ "${{ github.ref }}" == "refs/heads/main" ||
"${{ github.ref }}" == "refs/heads/develop" ||
"${{ github.ref }}" =~ ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ ]]; then
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then

echo "type=development" >> $GITHUB_OUTPUT
echo "continue=true" >> $GITHUB_OUTPUT

fi
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then

echo "type=development" >> $GITHUB_OUTPUT
echo "continue=true" >> $GITHUB_OUTPUT

fi
if [[ "${{ github.ref }}" =~ ^(refs\/heads\/releases\/)(v)(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ ]]; then

version=$(echo "${{ github.ref }}" | sed -n -E 's/^(refs\/heads\/releases\/)//p')
echo "version=$version" >> $GITHUB_OUTPUT
echo "type=release" >> $GITHUB_OUTPUT
echo "continue=true" >> $GITHUB_OUTPUT

echo "Context is torrust/torrust-tracker, and push is: main, develop, docker, or a tag with a semantic version"
echo "continue=true" >> $GITHUB_OUTPUT
fi
fi
fi
Expand Down Expand Up @@ -103,17 +117,28 @@ jobs:
runs-on: ubuntu-latest

steps:
- id: meta
name: Docker meta
- id: meta_development
if: needs.secrets.check.type == 'development'
name: Docker Meta (development)
uses: docker/metadata-action@v4
with:
images: |
"${{ secrets.DOCKER_HUB_USERNAME }}/${{secrets.DOCKER_HUB_REPOSITORY_NAME }}"
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- id: meta_release
if: needs.secrets.check.type == 'release'
name: Docker Meta (release)
uses: docker/metadata-action@v4
with:
images: |
"${{ secrets.DOCKER_HUB_USERNAME }}/${{secrets.DOCKER_HUB_REPOSITORY_NAME }}"
tags: |
type=semver,value=${{ needs.secrets.check.version }},pattern={{raw}}
type=semver,value=${{ needs.secrets.check.version }},pattern={{version}}
type=semver,value=${{ needs.secrets.check.version }},pattern=v{{major}}
type=semver,value=${{ needs.secrets.check.version }},pattern={{major}}.{{minor}}

- id: login
name: Login to Docker Hub
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Deployment

on:
push:
tags:
- "v*"
branches:
- "releases/**/*"

jobs:
secrets:
Expand All @@ -18,8 +18,8 @@ jobs:
- id: check
name: Check
env:
CRATES_TOKEN: "${{ secrets.CRATES_TOKEN }}"
if: "${{ env.CRATES_TOKEN != '' }}"
CARGO_REGISTRY_TOKEN: "${{ secrets.CARGO_REGISTRY_TOKEN }}"
if: "${{ env.CARGO_REGISTRY_TOKEN != '' }}"
run: echo "continue=true" >> $GITHUB_OUTPUT

test:
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
toolchain: stable

env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

- id: publish
name: Publish Crates
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ license-file = "COPYRIGHT"
publish = true
repository = "https://github.com/torrust/torrust-tracker"
rust-version = "1.72"
version = "3.0.0-alpha.4"
version = "3.0.0-alpha.5"


[dependencies]
Expand Down Expand Up @@ -66,10 +66,10 @@ axum = "0.6.20"
axum-server = { version = "0.5", features = ["tls-rustls"] }
axum-client-ip = "0.4.1"
tower-http = { version = "0.4.3", features = ["compression-full"] }
torrust-tracker-contrib-bencode = { version = "3.0.0-alpha.4", path = "contrib/bencode"}
torrust-tracker-primitives = { version = "3.0.0-alpha.4", path = "packages/primitives" }
torrust-tracker-configuration = { version = "3.0.0-alpha.4", path = "packages/configuration" }
torrust-tracker-located-error = { version = "3.0.0-alpha.4", path = "packages/located-error" }
torrust-tracker-contrib-bencode = { version = "3.0.0-alpha.5", path = "contrib/bencode"}
torrust-tracker-primitives = { version = "3.0.0-alpha.5", path = "packages/primitives" }
torrust-tracker-configuration = { version = "3.0.0-alpha.5", path = "packages/configuration" }
torrust-tracker-located-error = { version = "3.0.0-alpha.5", path = "packages/located-error" }
multimap = "0.9"
hyper = "0.14"

Expand All @@ -80,7 +80,7 @@ serde_urlencoded = "0.7"
serde_repr = "0.1"
serde_bytes = "0.11"
local-ip-address = "0.5"
torrust-tracker-test-helpers = { version = "3.0.0-alpha.4", path = "packages/test-helpers" }
torrust-tracker-test-helpers = { version = "3.0.0-alpha.5", path = "packages/test-helpers" }

[workspace]
members = [
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ This project was a joint effort by [Nautilus Cyberneering GmbH][nautilus] and [D

[containers.md]: ./docs/containers.md

[api]: https://docs.rs/torrust-tracker/3.0.0-alpha.4/torrust_tracker/servers/apis/v1
[http]: https://docs.rs/torrust-tracker/3.0.0-alpha.4/torrust_tracker/servers/http
[udp]: https://docs.rs/torrust-tracker/3.0.0-alpha.4/torrust_tracker/servers/udp
[api]: https://docs.rs/torrust-tracker/3.0.0-alpha.5/torrust_tracker/servers/apis/v1
[http]: https://docs.rs/torrust-tracker/3.0.0-alpha.5/torrust_tracker/servers/http
[udp]: https://docs.rs/torrust-tracker/3.0.0-alpha.5/torrust_tracker/servers/udp

[good first issues]: https://github.com/torrust/torrust-tracker/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[documentation]: https://docs.rs/torrust-tracker/
[API documentation]: https://docs.rs/torrust-tracker/3.0.0-alpha.4/torrust_tracker/servers/apis/v1
[API documentation]: https://docs.rs/torrust-tracker/3.0.0-alpha.5/torrust_tracker/servers/apis/v1
[discussions]: https://github.com/torrust/torrust-tracker/discussions

[COPYRIGHT]: ./COPYRIGHT
Expand Down
4 changes: 2 additions & 2 deletions packages/configuration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ config = "0.13"
toml = "0.7"
log = { version = "0.4", features = ["release_max_level_info"] }
thiserror = "1.0"
torrust-tracker-primitives = { version = "3.0.0-alpha.4", path = "../primitives" }
torrust-tracker-located-error = { version = "3.0.0-alpha.4", path = "../located-error" }
torrust-tracker-primitives = { version = "3.0.0-alpha.5", path = "../primitives" }
torrust-tracker-located-error = { version = "3.0.0-alpha.5", path = "../located-error" }

[dev-dependencies]
uuid = { version = "1", features = ["v4"] }
4 changes: 2 additions & 2 deletions packages/test-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ version.workspace = true
[dependencies]
lazy_static = "1.4"
rand = "0.8.5"
torrust-tracker-configuration = { version = "3.0.0-alpha.4", path = "../configuration" }
torrust-tracker-primitives = { version = "3.0.0-alpha.4", path = "../primitives" }
torrust-tracker-configuration = { version = "3.0.0-alpha.5", path = "../configuration" }
torrust-tracker-primitives = { version = "3.0.0-alpha.5", path = "../primitives" }