Skip to content

Commit 739066d

Browse files
committed
Merge #409: dev: use releases branch prefix
6665a05 dev: use releases branch prefix (Cameron Garnham) a53ee28 release: bump alpha version (Cameron Garnham) Pull request description: closes #407 ACKs for top commit: da2ce7: ACK 6665a05 Tree-SHA512: 4fcb8f7c0e06df4a71f6615fcb2d10f732e634a4c48e9f806e9b63ab923248348d6e1316bac65cb3538e306ce20566a8b8d228d5e8acca05253c10f879435a6e
2 parents f0ed5c0 + 6665a05 commit 739066d

7 files changed

Lines changed: 62 additions & 37 deletions

File tree

.github/workflows/container.yaml

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ on:
55
branches:
66
- "develop"
77
- "main"
8-
tags:
9-
- "v*"
8+
- "releases/**/*"
109
pull_request:
1110
branches:
1211
- "develop"
@@ -60,19 +59,34 @@ jobs:
6059

6160
outputs:
6261
continue: ${{ steps.check.outputs.continue }}
62+
type: ${{ steps.check.outputs.type }}
63+
version: ${{ steps.check.outputs.version }}
6364

6465
steps:
6566
- id: check
6667
name: Check Context
6768
run: |
6869
if [[ "${{ github.repository }}" == "torrust/torrust-tracker" ]]; then
6970
if [[ "${{ github.event_name }}" == "push" ]]; then
70-
if [[ "${{ github.ref }}" == "refs/heads/main" ||
71-
"${{ github.ref }}" == "refs/heads/develop" ||
72-
"${{ 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
71+
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
72+
73+
echo "type=development" >> $GITHUB_OUTPUT
74+
echo "continue=true" >> $GITHUB_OUTPUT
75+
76+
fi
77+
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
78+
79+
echo "type=development" >> $GITHUB_OUTPUT
80+
echo "continue=true" >> $GITHUB_OUTPUT
81+
82+
fi
83+
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
84+
85+
version=$(echo "${{ github.ref }}" | sed -n -E 's/^(refs\/heads\/releases\/)//p')
86+
echo "version=$version" >> $GITHUB_OUTPUT
87+
echo "type=release" >> $GITHUB_OUTPUT
88+
echo "continue=true" >> $GITHUB_OUTPUT
7389
74-
echo "Context is torrust/torrust-tracker, and push is: main, develop, docker, or a tag with a semantic version"
75-
echo "continue=true" >> $GITHUB_OUTPUT
7690
fi
7791
fi
7892
fi
@@ -103,17 +117,28 @@ jobs:
103117
runs-on: ubuntu-latest
104118

105119
steps:
106-
- id: meta
107-
name: Docker meta
120+
- id: meta_development
121+
if: needs.secrets.check.type == 'development'
122+
name: Docker Meta (development)
108123
uses: docker/metadata-action@v4
109124
with:
110125
images: |
111126
"${{ secrets.DOCKER_HUB_USERNAME }}/${{secrets.DOCKER_HUB_REPOSITORY_NAME }}"
112127
tags: |
113128
type=ref,event=branch
114-
type=ref,event=pr
115-
type=semver,pattern={{version}}
116-
type=semver,pattern={{major}}.{{minor}}
129+
130+
- id: meta_release
131+
if: needs.secrets.check.type == 'release'
132+
name: Docker Meta (release)
133+
uses: docker/metadata-action@v4
134+
with:
135+
images: |
136+
"${{ secrets.DOCKER_HUB_USERNAME }}/${{secrets.DOCKER_HUB_REPOSITORY_NAME }}"
137+
tags: |
138+
type=semver,value=${{ needs.secrets.check.version }},pattern={{raw}}
139+
type=semver,value=${{ needs.secrets.check.version }},pattern={{version}}
140+
type=semver,value=${{ needs.secrets.check.version }},pattern=v{{major}}
141+
type=semver,value=${{ needs.secrets.check.version }},pattern={{major}}.{{minor}}
117142
118143
- id: login
119144
name: Login to Docker Hub

.github/workflows/deployment.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Deployment
22

33
on:
44
push:
5-
tags:
6-
- "v*"
5+
branches:
6+
- "releases/**/*"
77

88
jobs:
99
secrets:
@@ -18,8 +18,8 @@ jobs:
1818
- id: check
1919
name: Check
2020
env:
21-
CRATES_TOKEN: "${{ secrets.CRATES_TOKEN }}"
22-
if: "${{ env.CRATES_TOKEN != '' }}"
21+
CARGO_REGISTRY_TOKEN: "${{ secrets.CARGO_REGISTRY_TOKEN }}"
22+
if: "${{ env.CARGO_REGISTRY_TOKEN != '' }}"
2323
run: echo "continue=true" >> $GITHUB_OUTPUT
2424

2525
test:
@@ -66,7 +66,7 @@ jobs:
6666
toolchain: stable
6767

6868
env:
69-
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}
69+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
7070

7171
- id: publish
7272
name: Publish Crates

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ license-file = "COPYRIGHT"
2929
publish = true
3030
repository = "https://github.com/torrust/torrust-tracker"
3131
rust-version = "1.72"
32-
version = "3.0.0-alpha.4"
32+
version = "3.0.0-alpha.5"
3333

3434

3535
[dependencies]
@@ -66,10 +66,10 @@ axum = "0.6.20"
6666
axum-server = { version = "0.5", features = ["tls-rustls"] }
6767
axum-client-ip = "0.4.1"
6868
tower-http = { version = "0.4.3", features = ["compression-full"] }
69-
torrust-tracker-contrib-bencode = { version = "3.0.0-alpha.4", path = "contrib/bencode"}
70-
torrust-tracker-primitives = { version = "3.0.0-alpha.4", path = "packages/primitives" }
71-
torrust-tracker-configuration = { version = "3.0.0-alpha.4", path = "packages/configuration" }
72-
torrust-tracker-located-error = { version = "3.0.0-alpha.4", path = "packages/located-error" }
69+
torrust-tracker-contrib-bencode = { version = "3.0.0-alpha.5", path = "contrib/bencode"}
70+
torrust-tracker-primitives = { version = "3.0.0-alpha.5", path = "packages/primitives" }
71+
torrust-tracker-configuration = { version = "3.0.0-alpha.5", path = "packages/configuration" }
72+
torrust-tracker-located-error = { version = "3.0.0-alpha.5", path = "packages/located-error" }
7373
multimap = "0.9"
7474
hyper = "0.14"
7575

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

8585
[workspace]
8686
members = [

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,13 @@ This project was a joint effort by [Nautilus Cyberneering GmbH][nautilus] and [D
179179

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

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

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

191191
[COPYRIGHT]: ./COPYRIGHT

packages/configuration/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ config = "0.13"
2222
toml = "0.7"
2323
log = { version = "0.4", features = ["release_max_level_info"] }
2424
thiserror = "1.0"
25-
torrust-tracker-primitives = { version = "3.0.0-alpha.4", path = "../primitives" }
26-
torrust-tracker-located-error = { version = "3.0.0-alpha.4", path = "../located-error" }
25+
torrust-tracker-primitives = { version = "3.0.0-alpha.5", path = "../primitives" }
26+
torrust-tracker-located-error = { version = "3.0.0-alpha.5", path = "../located-error" }
2727

2828
[dev-dependencies]
2929
uuid = { version = "1", features = ["v4"] }

packages/test-helpers/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ version.workspace = true
1717
[dependencies]
1818
lazy_static = "1.4"
1919
rand = "0.8.5"
20-
torrust-tracker-configuration = { version = "3.0.0-alpha.4", path = "../configuration" }
21-
torrust-tracker-primitives = { version = "3.0.0-alpha.4", path = "../primitives" }
20+
torrust-tracker-configuration = { version = "3.0.0-alpha.5", path = "../configuration" }
21+
torrust-tracker-primitives = { version = "3.0.0-alpha.5", path = "../primitives" }

0 commit comments

Comments
 (0)