diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 233e7d6d..66d7e977 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -89,47 +89,3 @@ jobs: fail_ci_if_error: true directory: "./reports/coverage/" verbose: true - - pre-release-version: - runs-on: ubuntu-latest - if: startsWith(github.event.pull_request.title, 'Release v') - outputs: - version: ${{ steps.get-version.outputs.version }} - steps: - - id: get-version - run: | - fullname="${{github.event.pull_request.title}}" - echo "version=${fullname#"Release "}" >> $GITHUB_OUTPUT - - pip-test: - runs-on: ubuntu-latest - if: startsWith(github.event.pull_request.title, 'Release v') - steps: - - uses: actions/checkout@v4 - - uses: mamba-org/setup-micromamba@v1 - with: - micromamba-version: '1.5.10-0' - environment-name: pipbuild - create-args: >- - python=3.11 - pip - python-build - post-cleanup: all - cache-environment: true - - name: Build package - run: python -m build - - name: Test package install - run: | - pip install dist/calliope-*.tar.gz - calliope --help - - pre-release: - needs: [test, pre-release-version, pip-test] - if: needs.pip-test.result == 'success' && needs.test.result == 'success' && startsWith(github.event.pull_request.title, 'Release v') - uses: arup-group/actions-city-modelling-lab/.github/workflows/pip-build.yml@main - secrets: - TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} - with: - package_name: calliope - version: ${{needs.pre-release-version.outputs.version}} - pip_args: '' diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml new file mode 100644 index 00000000..75c28165 --- /dev/null +++ b/.github/workflows/pre-release.yml @@ -0,0 +1,62 @@ +name: Pre-release CD + +on: + pull_request: + branches: + - "main" + +defaults: + run: + shell: bash -l {0} + +concurrency: + # Use github.run_id on main branch + # Use github.event.pull_request.number on pull requests, so it's unique per pull request + # Use github.ref on other branches, so it's unique per branch + group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + pre-release-version: + runs-on: ubuntu-latest + if: startsWith(github.event.pull_request.title, 'Release v') + outputs: + version: ${{ steps.get-version.outputs.version }} + steps: + - id: get-version + run: | + fullname="${{github.event.pull_request.title}}" + echo "version=${fullname#"Release "}" >> $GITHUB_OUTPUT + + pip-test: + runs-on: ubuntu-latest + if: startsWith(github.event.pull_request.title, 'Release v') + steps: + - uses: actions/checkout@v4 + - uses: mamba-org/setup-micromamba@v1 + with: + micromamba-version: '1.5.10-0' + environment-name: pipbuild + create-args: >- + python=3.11 + pip + python-build + post-cleanup: all + cache-environment: true + - name: Build package + run: python -m build + - name: Test package install + run: | + pip install dist/calliope-*.tar.gz + calliope --help + + pre-release: + needs: [pre-release-version, pip-test] + if: needs.pip-test.result == 'success' && startsWith(github.event.pull_request.title, 'Release v') + uses: arup-group/actions-city-modelling-lab/.github/workflows/pip-build.yml@main + secrets: + TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} + with: + package_name: calliope + version: ${{needs.pre-release-version.outputs.version}} + pip_args: '' diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ca4a693..a992a83f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.7.0.dev5 (Unreleased) +## 0.7.0.dev5 (2024-12-04) ### User-facing changes