mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 14:40:26 -05:00
Remove publish to TestPyPi
This commit is contained in:
1 parent
21bd5730f5
commit
84671d1027
1 file changed
+2
-62
@@ -106,7 +106,7 @@ jobs:
|
||||
elseif ("${{ runner.os }}" STREQUAL "macOS")
|
||||
set(buildcache_suffix "macos.zip")
|
||||
elseif ("${{ runner.os }}" STREQUAL "Linux")
|
||||
set(buildcache_suffix "linux.tar.gz")
|
||||
set(buildcache_suffix "linux-amd64.tar.gz")
|
||||
endif()
|
||||
|
||||
set(buildcache_url "https://gitlab.com/bits-n-bites/buildcache/-/releases/permalink/latest/downloads/buildcache-${buildcache_suffix}")
|
||||
@@ -179,7 +179,7 @@ jobs:
|
||||
|
||||
- name: Restore vcpkg cache
|
||||
id: vcpkg-cache
|
||||
uses: TAServers/vcpkg-cache@v3
|
||||
uses: TAServers/vcpkg-cache@v3.3.1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
prefix: vcpkg-${{ matrix.config.cxx}}/
|
||||
@@ -287,63 +287,3 @@ jobs:
|
||||
- name: Publish Python package to pypi
|
||||
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
|
||||
test-pypi-publish:
|
||||
name: Upload build to TestPyPI
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: pypi
|
||||
url: https://pypi.org/p/rips
|
||||
permissions:
|
||||
id-token: write # Required for trusted publishing
|
||||
contents: write # Required to create a tag
|
||||
|
||||
if: github.base_ref == 'dev' || github.ref == 'refs/heads/dev'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Extract version
|
||||
id: get_version
|
||||
run: |
|
||||
# Extract version from ResInsightVersion.cmake file
|
||||
MAJOR=$(grep "RESINSIGHT_MAJOR_VERSION" ResInsightVersion.cmake | sed 's/[^0-9]*//g')
|
||||
MINOR=$(grep "RESINSIGHT_MINOR_VERSION" ResInsightVersion.cmake | sed 's/[^0-9]*//g')
|
||||
PATCH=$(grep "RESINSIGHT_PATCH_VERSION" ResInsightVersion.cmake | sed 's/[^0-9]*//g')
|
||||
VERSION_TEXT=$(grep "RESINSIGHT_VERSION_TEXT" ResInsightVersion.cmake | grep -v "#" | head -1 | cut -d'"' -f2)
|
||||
DEV_VERSION=$(grep "RESINSIGHT_DEV_VERSION" ResInsightVersion.cmake | grep -v "#" | head -1 | cut -d'"' -f2)
|
||||
|
||||
VERSION="${MAJOR}.${MINOR}.${PATCH}${VERSION_TEXT}${DEV_VERSION}"
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
echo "Full version: $VERSION"
|
||||
|
||||
# Check if tag exists
|
||||
git fetch --tags
|
||||
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
|
||||
echo "Tag v$VERSION already exists, skipping publish"
|
||||
echo "SHOULD_PUBLISH=false" >> $GITHUB_ENV
|
||||
else
|
||||
echo "Tag v$VERSION does not exist, will publish"
|
||||
echo "SHOULD_PUBLISH=true" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Create tag
|
||||
if: env.SHOULD_PUBLISH == 'true'
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git tag -a "v$VERSION" -m "Dev v$VERSION"
|
||||
git push origin "v$VERSION"
|
||||
|
||||
- name: Download python distribution folder
|
||||
if: env.SHOULD_PUBLISH == 'true'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: python-distribution
|
||||
path: dist
|
||||
|
||||
- name: Publish Python package to TestPyPi
|
||||
if: env.SHOULD_PUBLISH == 'true'
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
repository-url: https://test.pypi.org/legacy/
|
||||
Reference in new issue
Block a user