From 2067126039de1e2d2561162075a806fe2839ffad Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Mon, 8 Jul 2024 16:04:22 +0200 Subject: [PATCH 1/2] Added checklist for new release --- doc/checklist_new_release.md | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 doc/checklist_new_release.md diff --git a/doc/checklist_new_release.md b/doc/checklist_new_release.md new file mode 100644 index 000000000..8ea547c56 --- /dev/null +++ b/doc/checklist_new_release.md @@ -0,0 +1,44 @@ +The following steps should be performed before releasing a new carl-storm version. + +1. Update `CHANGELOG.md`: + * To get all the commits from an author since the last tag execute: + ```console + git log last_tag..HEAD --author "author_name" + ``` + * Set release month + +2. Check that carl builds without errors and all tests are successful: + * [Github Actions](https://github.com/moves-rwth/carl-storm/actions/) should run successfully. + +3. Set new carl version: + * Set new version in `CMakeLists.txt` + +4. Set new tag in Git (assuming that the new version is X.Y.Z and that the remote "origin" is the github repo). + Use the flag `-s` to sign the tag. + ```console + git tag -a X.Y.Z -m "Storm version X.Y.Z" + git push origin X.Y.Z + ``` + The new tag should now be visible on [GitHub](https://github.com/moves-rwth/carl-storm/tags). + +5. Use the [CI](https://github.com/moves-rwth/carl-storm/actions/workflows/release_docker.yml) on the tag, provide the version `X.Y.Z` as tag and automatically create the [Docker containers](https://hub.docker.com/r/movesrwth/carl-storm) for the new version. + +6. [Add new release](https://github.com/moves-rwth/carl-storm/releases/new) in GitHub. + +7. Update `stable` branch: + + ```console + git checkout stable + git rebase master + git push origin stable + ``` + Note: Rebasing might fail if `stable` is ahead of `master` (e.g. because of merge commits). In this case we can do: + ```console + git checkout stable + git reset --hard master + git push --force origin stable + ``` + +8. Use the [CI](https://github.com/moves-rwth/carl-storm/actions/workflows/release_docker.yml) on the `stable` branch, provide the tag 'stable' and automatically create the [Docker containers](https://hub.docker.com/r/movesrwth/carl-storm). + +9. Update [Homebrew formula](https://github.com/moves-rwth/homebrew-misc). From 2f92cce1654b014602c72aee786e46f10f1776c1 Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Mon, 8 Jul 2024 16:14:13 +0200 Subject: [PATCH 2/2] Revised CI --- .github/workflows/buildtest.yml | 76 ++++++++++++++-------------- .github/workflows/release_docker.yml | 2 +- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index cfd9a8713..4922a34f7 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -18,74 +18,76 @@ env: NR_JOBS: "2" jobs: - indepthTests: - name: Build and Test + distroTests: + name: Distro Tests (${{ matrix.distro }}, ${{ matrix.buildType }}) runs-on: ubuntu-latest strategy: matrix: distro: ["debian-11", "debian-12", "ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04", "minimal_dependencies"] - debugOrRelease: ["debug", "release"] + buildType: ["Debug", "Release"] steps: - - name: Setup configuration - # this is strangely the best way to implement environment variables based on the value of another - # GITHUB_ENV is a magic variable pointing to a file; if a line with format {NAME}={VALUE} - # then the env variable with name NAME will be created/updated with VALUE - run: | - ([[ ${{ matrix.debugOrRelease }} == "debug" ]] && echo "BUILD_TYPE=Debug" || echo "BUILD_TYPE=Release") >> $GITHUB_ENV - name: Git clone uses: actions/checkout@v4 - - - name: Build Carl-storm - run: docker build -t movesrwth/carl-storm:ci-${{ matrix.debugOrRelease }} . --build-arg BASE_IMAGE=movesrwth/storm-basesystem:${{ matrix.distro }} --build-arg build_type=${BUILD_TYPE} --build-arg no_threads=${NR_JOBS} + - name: Build Carl-storm from Dockerfile + run: | + docker build -t movesrwth/carl-storm:ci . \ + --build-arg BASE_IMAGE=movesrwth/storm-basesystem:${{ matrix.distro }} \ + --build-arg build_type="${{ matrix.buildType }}" \ + --build-arg no_threads=${NR_JOBS} - name: Run Docker - run: docker run -d -it --name ci --privileged movesrwth/carl-storm:ci-${{ matrix.debugOrRelease }} + run: docker run -d -it --name ci movesrwth/carl-storm:ci - name: Build tests run: docker exec ci bash -c "cd /opt/carl/build; make -j ${NR_JOBS}" - - name: Run unit tests + - name: Run tests run: docker exec ci bash -c "cd /opt/carl/build; ctest test --output-on-failure" deploy: - name: Build, Test and Deploy + name: Test and Deploy (${{ matrix.buildType.name }}) runs-on: ubuntu-latest strategy: matrix: - distro: ["latest"] - debugOrRelease: ["debug", "release"] + buildType: + - {name: "Debug", + dockerTag: "ci-debug", + distro: "storm-basesystem:latest" + } + - {name: "Release", + dockerTag: "ci", + distro: "storm-basesystem:latest" + } steps: - - name: Setup cmake arguments - # this is strangely the best way to implement environment variables based on the value of another - # GITHUB_ENV is a magic variable pointing to a file; if a line with format {NAME}={VALUE} - # then the env variable with name NAME will be created/updated with VALUE - run: | - ([[ ${{ matrix.debugOrRelease }} == "debug" ]] && echo "BUILD_TYPE=Debug" || echo "BUILD_TYPE=Release") >> $GITHUB_ENV - - - name: Login into docker - # Only login if using master on original repo (and not for pull requests or forks) - if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master' - run: echo "${{ secrets.STORM_CI_DOCKER_PASSWORD }}" | docker login -u "${{ secrets.STORM_CI_DOCKER_USERNAME }}" --password-stdin - name: Git clone uses: actions/checkout@v4 - - - name: Build Carl-storm - run: docker build -t movesrwth/carl-storm:ci-${{ matrix.debugOrRelease }} . --build-arg BASE_IMAGE=movesrwth/storm-basesystem:${{ matrix.distro }} --build-arg build_type=${BUILD_TYPE} --build-arg no_threads=${NR_JOBS} + - name: Build Carl-storm from Dockerfile + run: | + docker build -t movesrwth/carl-storm:${{ matrix.buildType.dockerTag }} . \ + --build-arg BASE_IMAGE=movesrwth/${{ matrix.buildType.distro }} \ + --build-arg build_type="${{ matrix.buildType.name }}" \ + --build-arg no_threads=${NR_JOBS} - name: Run Docker - run: docker run -d -it --name ci movesrwth/carl-storm:ci-${{ matrix.debugOrRelease }} + run: docker run -d -it --name ci movesrwth/carl-storm:${{ matrix.buildType.dockerTag }} - name: Build tests run: docker exec ci bash -c "cd /opt/carl/build; make -j ${NR_JOBS}" - - name: Run unit tests + - name: Run tests run: docker exec ci bash -c "cd /opt/carl/build; ctest test --output-on-failure" + - name: Login into docker + # Only login if using master on original repo (and not for pull requests or forks) + if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master' + uses: docker/login-action@v3 + with: + username: ${{ secrets.STORM_CI_DOCKER_USERNAME }} + password: ${{ secrets.STORM_CI_DOCKER_TOKEN }} - name: Deploy carl # Only deploy if using master on original repo (and not for pull requests or forks) if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master' run: | - docker commit ci movesrwth/carl-storm:ci-${{ matrix.debugOrRelease }} - docker push movesrwth/carl-storm:ci-${{ matrix.debugOrRelease }} - + docker commit ci movesrwth/carl-storm:${{ matrix.buildType.dockerTag }} + docker push movesrwth/carl-storm:${{ matrix.buildType.dockerTag }} notify: name: Email notification runs-on: ubuntu-latest - needs: [indepthTests, deploy] + needs: [distroTests, deploy] # Only run in main repo and even if previous step failed if: github.repository_owner == 'moves-rwth' && always() steps: diff --git a/.github/workflows/release_docker.yml b/.github/workflows/release_docker.yml index 9695f2c00..cf4465dee 100644 --- a/.github/workflows/release_docker.yml +++ b/.github/workflows/release_docker.yml @@ -15,7 +15,7 @@ env: jobs: deploy: - name: Deploy (${{ matrix.buildtType.name }}) + name: Deploy (${{ matrix.buildType.name }}) runs-on: ubuntu-latest strategy: matrix: