From bfa8c7d5bdfb7eabab89dddc6888ea0d6e74fafb Mon Sep 17 00:00:00 2001 From: Simon Liu <69875423+sliu008@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:04:51 -0800 Subject: [PATCH 1/2] Feature/new versioning (#42) * fix versioning for release * new versioning * new version * change release versioning --- .github/workflows/build.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bde1046..a55a95f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: elif [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then new_version=$(poetry version prerelease -s) elif [[ "${{ github.ref }}" =~ ^refs/heads/release/ ]]; then - if [[ ${current_version} =~ -rc ]]; then + if [[ ${current_version} =~ rc ]]; then new_version=$(poetry version prerelease -s) else new_version="${GITHUB_REF#refs/heads/release/}rc1" @@ -129,7 +129,8 @@ jobs: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release') || - contains(github.event.head_commit.message, '/deploy') + github.event.head_commit.message == '/deploy sit' || + github.event.head_commit.message == '/deploy uat' uses: ncipollo/release-action@v1.14.0 with: tag: ${{ env.new_version }} @@ -174,7 +175,8 @@ jobs: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release') || - contains(github.event.head_commit.message, '/deploy') + github.event.head_commit.message == '/deploy sit' || + github.event.head_commit.message == '/deploy uat' ) runs-on: ubuntu-latest permissions: @@ -209,7 +211,9 @@ jobs: fi - name: Deploy Env Override - if: contains(github.event.head_commit.message, '/deploy') + if: | + github.event.head_commit.message == '/deploy sit' || + github.event.head_commit.message == '/deploy uat' run: | message="${{ github.event.head_commit.message }}" trimmed_message=${message:1} # Remove leading slash @@ -231,7 +235,7 @@ jobs: flavor: | latest=${{ github.ref == 'refs/heads/main' }} tags: | - type=semver,pattern={{raw}},value=${{ needs.build.outputs.version }} + type=pep440,pattern={{version}},value=${{ needs.build.outputs.version }} type=raw,value=${{ env.TARGET_ENV_LOWERCASE }} - name: Set Build Source @@ -241,8 +245,8 @@ jobs: echo "SOURCE=${{ needs.build.outputs.pyproject_name }}==${{ needs.build.outputs.version }}" >> $GITHUB_ENV # Override source if deploying (find .whl file in dist/) - if [[ "${{ contains(github.event.head_commit.message, '/deploy sit') || - contains(github.event.head_commit.message, '/deploy uat') }}" == "true" ]]; then + if [[ "${{ github.event.head_commit.message }}" == "/deploy sit" || + "${{ github.event.head_commit.message }}" == "/deploy uat" ]]; then local_forge_py=$(find dist -type f -name "*.whl") echo "SOURCE=${local_forge_py}" >> $GITHUB_ENV echo "DIST_PATH=dist/" >> $GITHUB_ENV From f9a7c3d237c97872d3f80dc6927f08684d08e12d Mon Sep 17 00:00:00 2001 From: jamesfwood Date: Tue, 14 Jan 2025 21:06:21 +0000 Subject: [PATCH 2/2] /version 0.4.0rc2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b6cd5f4..219adde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "forge-py" -version = "0.4.0rc1" +version = "0.4.0rc2" description = "forge-py is a footprint generator (FOotpRint GEnerator) from science data netcdf files" authors = ["James Wood "] readme = "README.md"