From d09fa65b77a330525ee4f037a06c2a1f91cdefbb Mon Sep 17 00:00:00 2001 From: Cameron Garnham Date: Mon, 11 Sep 2023 10:56:44 +0200 Subject: [PATCH 1/3] dev: fixup container workfows bug --- .github/workflows/container.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml index 93ce87506..d541cc3aa 100644 --- a/.github/workflows/container.yaml +++ b/.github/workflows/container.yaml @@ -118,7 +118,7 @@ jobs: steps: - id: meta_development - if: needs.secrets.check.type == 'development' + if: needs.context.check.type == 'development' name: Docker Meta (development) uses: docker/metadata-action@v4 with: @@ -128,17 +128,17 @@ jobs: type=ref,event=branch - id: meta_release - if: needs.secrets.check.type == 'release' + if: needs.context.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}} + type=semver,value=${{ needs.context.check.version }},pattern={{raw}} + type=semver,value=${{ needs.context.check.version }},pattern={{version}} + type=semver,value=${{ needs.context.check.version }},pattern=v{{major}} + type=semver,value=${{ needs.context.check.version }},pattern={{major}}.{{minor}} - id: login name: Login to Docker Hub From d9a506a54687ac6c7fda07abc4ae8bcc4ec3e5fd Mon Sep 17 00:00:00 2001 From: Cameron Garnham Date: Mon, 11 Sep 2023 10:57:46 +0200 Subject: [PATCH 2/3] docs: draft release process document --- docs/release_process.md | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 docs/release_process.md diff --git a/docs/release_process.md b/docs/release_process.md new file mode 100644 index 000000000..cc401c11a --- /dev/null +++ b/docs/release_process.md @@ -0,0 +1,61 @@ +# Torrust Tracker Release Process (draft) + +The purpose of this document is to describe the release process. + +## Overview + +Torrust Tracker is published in this order: + +1. `develop` branch is ready for publishing. +2. create `release: version (semantic version)` commit. +3. push release commit to `main` branch. +4. check all status checks succeed for `main` branch. +5. push `main` branch to `releases\v(semantic version)` branch. +6. check all status checks success for `releases\v(semantic version)` branch. +7. create signed `v(semantic version)` tag. +8. create github release from `v(semantic version)` tag. +9. merge `main` branch into `develop` branch. + +- At step `1.`, `develop` is automatically published to `dockerhub`. +- At step `3.`, `main` is automatically published to `dockerhub`. +- At step `5.`, `releases\v(semantic version)` is automatically published to `dockerhub` and `crate.io`. + +## Development Branch + +The `develop` branch, the default branch for the repository is automatically published to dockerhub with the `develop` label. This process happens automatically when a pull request is merged in, and the `container.yaml` workflow is triggered. + +## Main Branch + +The `main` branch is the staging branch for releases. + +A release commit needs to be made that prepares the repository for the release, this commit should include: + +- Changing the semantic version. +- Finalizing the release notes and changelog. + +The title of the commit should be: `release: version (semantic version)`. + +This commit should be committed upon the head of the development branch, and pushed to the `main` branch. + +Once the release has succeeded, the `main` branch should be merged back into the `develop` branch. + +## Releases Branch + +According to the patten `releases/v(semantic version)`, the `main` branch head is published to here to trigger the deployment workflows. + +The repository deployment environment for crates.io is only available for the `releases/**/*` patten of branches. + +Once the publishing workflows have succeeded; we can make the git-tag. + +## Release Tag + +Create a Signed Tag with a short message in the form `v(semantic version)` and push it to the repository. + +## Github Release + +From the newly published tag, create a Github Release using the web-interface. + + +## Merge back into development branch + +After this is all successful, the `main` branch should be merged into the `develop` branch. From 7365423eb8748a60151615b5be1a201402f1d9a7 Mon Sep 17 00:00:00 2001 From: Cameron Garnham Date: Mon, 11 Sep 2023 11:17:25 +0200 Subject: [PATCH 3/3] ci: use coverage environment --- .github/workflows/coverage.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 6a99fb11a..df308e329 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -8,8 +8,27 @@ env: CARGO_TERM_COLOR: always jobs: + secrets: + name: Secrets + environment: coverage + runs-on: ubuntu-latest + + outputs: + continue: ${{ steps.check.outputs.continue }} + + steps: + - id: check + name: Check + env: + CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" + if: "${{ env.CODECOV_TOKEN != '' }}" + run: echo "continue=true" >> $GITHUB_OUTPUT + report: name: Report + environment: coverage + needs: secrets + if: needs.secrets.outputs.continue == 'true' runs-on: ubuntu-latest env: CARGO_INCREMENTAL: "0"