From 1b18be683c31985c3a0c6069716dddd7e1adf8f4 Mon Sep 17 00:00:00 2001 From: Ronen Hilewicz Date: Fri, 6 Dec 2024 07:56:30 -0500 Subject: [PATCH] Remove mage --- .github/workflows/ci.yaml | 169 +++++++++++++++++--------------------- Depfile | 5 -- mage.go | 12 --- magefiles/go.mod | 58 ------------- magefiles/go.sum | 126 ---------------------------- magefiles/magefile.go | 70 ---------------- 6 files changed, 76 insertions(+), 364 deletions(-) delete mode 100644 Depfile delete mode 100644 mage.go delete mode 100644 magefiles/go.mod delete mode 100644 magefiles/go.sum delete mode 100644 magefiles/magefile.go diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index befdba7..2ac8312 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,3 +1,4 @@ +--- name: ci on: @@ -15,56 +16,57 @@ on: env: VAULT_ADDR: https://vault.eng.aserto.com/ - GO_VERSION: "1.22" + PYTHON_VERSION: "3.9" + POETRY_VERSION: "1.8.3" jobs: test: name: Run test runs-on: ubuntu-latest steps: - - name: Read Configuration - uses: hashicorp/vault-action@v3 - id: vault - with: - url: ${{ env.VAULT_ADDR }} - token: ${{ secrets.VAULT_TOKEN }} - secrets: | - kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY; - - - name: Setup git - run: | - mkdir -p $HOME/.ssh - umask 0077 && echo -e "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa - ssh-keyscan github.com >> $HOME/.ssh/known_hosts - git config --global url."git@github.com:".insteadOf https://github.com/ - - - name: Checkout Repo + - + name: Checkout Repo uses: actions/checkout@v4 - - - name: Set up Homebrew - uses: Homebrew/actions/setup-homebrew@master - - - name: Install topaz - run: brew tap aserto-dev/tap && brew install aserto-dev/tap/topaz && topaz install - - - name: Use python 3.9 + - + name: Install topaz CLI + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release download v${{ env.TOPAZ_VERSION }} --repo aserto-dev/topaz --pattern "topaz_linux_x86_64.zip" \ + --output ./ext/topaz.zip --clobber + unzip ./ext/topaz.zip -d bin + chmod +x ./bin/topaz + ./bin/topaz version + echo "TOPAZ=$(realpath ./bin/topaz)" >> "$GITHUB_ENV" + echo "TOPAZ_CERTS_DIR=$(./bin/topaz config info | jq '.config.topaz_certs_dir' -r)" >> "$GITHUB_ENV" + - + name: Install topazd container + run: | + ${TOPAZ} install --container-tag=${{ env.TOPAZ_VERSION }} + ${TOPAZ} version + - + name: Generate topaz certs + run: ${TOPAZ} certs generate + - + name: Setup python uses: actions/setup-python@v5 with: - python-version: '3.12' - - - name: Install and configure Poetry + python-version: ${{ env.PYTHON_VERSION }} + - + name: Install and configure Poetry uses: snok/install-poetry@v1 with: - version: 1.8.3 + version: ${{ env.POETRY_VERSION }} + - + name: Install dependencies + run: poetry install + - + name: Lint + run: poetry run pyright . + - + name: Test + run: poetry run pytest -vv - - name: Run lint - run: | - poetry install - poetry run pyright . - - - name: Run tests - run: | - poetry run pytest -vv release: runs-on: ubuntu-latest needs: test @@ -72,76 +74,57 @@ jobs: name: Release to pypi steps: - - name: Read Configuration + - + uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ vars.CODEGEN_APP_ID }} + private-key: ${{ secrets.CODEGEN_APP_KEY }} + - + name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ steps.app-token.outputs.token }} + - + name: Read Configuration uses: hashicorp/vault-action@v3 id: vault with: url: ${{ env.VAULT_ADDR }} token: ${{ secrets.VAULT_TOKEN }} secrets: | - kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY; kv/data/pypi "API_TOKEN" | POETRY_HTTP_BASIC_PYPI_PASSWORD; - - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Setup caching - uses: actions/cache@v4 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - .ext - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum', 'Depfile') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Install dependencies - run: | - mkdir -p $HOME/.ssh - umask 0077 && echo -e "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa - ssh-keyscan github.com >> $HOME/.ssh/known_hosts - - git config --global url."git@github.com:".insteadOf https://github.com/ - git config --global user.email "github-bot@aserto.com" - git config --global user.name "Aserto Bot" - - eval `ssh-agent` - ssh-add $HOME/.ssh/id_rsa - - go run mage.go deps - - - name: Set up Python + - + name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.12' - - - name: Install Poetry + python-version: ${{ env.PYTHON_VERSION }} + - + name: Install Poetry uses: snok/install-poetry@v1 with: - version: 1.8.3 - - - name: Build and push the python package + version: ${{ env.POETRY_VERSION }} + - + name: Build + run: poetry build + - + name: Publish env: # When using a PYPI API token, the user name must be set to "__token__" POETRY_HTTP_BASIC_PYPI_USERNAME: __token__ - run: go run mage.go release - - - name: Bump to the next version - run: go run mage.go bump patch - - - name: Commit changes + run: | + poetry publish + - + name: Bump version + id: bump + uses: callowayproject/bump-my-version@master + with: + args: patch + - + name: Commit changes uses: EndBug/add-and-commit@v9 with: default_author: github_actions - message: 'Bump to next version' + message: 'Bump version: ${{ steps.bump.outputs.current-version }}' add: 'pyproject.toml' - push: origin HEAD:main - diff --git a/Depfile b/Depfile deleted file mode 100644 index 6479cf5..0000000 --- a/Depfile +++ /dev/null @@ -1,5 +0,0 @@ ---- -go: - sver: - importPath: "github.com/aserto-dev/sver/cmd/sver" - version: "v1.3.13" diff --git a/mage.go b/mage.go deleted file mode 100644 index a7e1699..0000000 --- a/mage.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build zeroinstall -// +build zeroinstall - -package main - -import ( - "os" - - "github.com/magefile/mage/mage" -) - -func main() { os.Exit(mage.Main()) } diff --git a/magefiles/go.mod b/magefiles/go.mod deleted file mode 100644 index 7e8de89..0000000 --- a/magefiles/go.mod +++ /dev/null @@ -1,58 +0,0 @@ -module github.com/aserto-dev/python-authorizer/magefiles - -go 1.22.0 - -toolchain go1.22.8 - -require ( - github.com/aserto-dev/mage-loot v0.8.17 - github.com/magefile/mage v1.15.0 -) - -require ( - dario.cat/mergo v1.0.1 // indirect - github.com/BobuSumisu/aho-corasick v1.0.3 // indirect - github.com/OneOfOne/xxhash v1.2.8 // indirect - github.com/aserto-dev/clui v0.8.3 // indirect - github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/charmbracelet/lipgloss v1.0.0 // indirect - github.com/charmbracelet/x/ansi v0.4.2 // indirect - github.com/fatih/color v1.18.0 // indirect - github.com/fatih/semgroup v1.3.0 // indirect - github.com/fsnotify/fsnotify v1.8.0 // indirect - github.com/gitleaks/go-gitdiff v0.9.1 // indirect - github.com/h2non/filetype v1.1.3 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/kyokomi/emoji v2.2.4+incompatible // indirect - github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/magiconair/properties v1.8.7 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.16 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/muesli/termenv v0.15.2 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/pelletier/go-toml/v2 v2.2.3 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/rivo/uniseg v0.4.7 // indirect - github.com/rs/zerolog v1.33.0 // indirect - github.com/sagikazarmark/locafero v0.6.0 // indirect - github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/sourcegraph/conc v0.3.0 // indirect - github.com/spf13/afero v1.11.0 // indirect - github.com/spf13/cast v1.7.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.19.0 // indirect - github.com/subosito/gotenv v1.6.0 // indirect - github.com/ulikunitz/xz v0.5.12 // indirect - github.com/zricethezav/gitleaks/v8 v8.21.2 // indirect - go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/term v0.25.0 // indirect - golang.org/x/text v0.19.0 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/magefiles/go.sum b/magefiles/go.sum deleted file mode 100644 index cae62e7..0000000 --- a/magefiles/go.sum +++ /dev/null @@ -1,126 +0,0 @@ -dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= -dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/BobuSumisu/aho-corasick v1.0.3 h1:uuf+JHwU9CHP2Vx+wAy6jcksJThhJS9ehR8a+4nPE9g= -github.com/BobuSumisu/aho-corasick v1.0.3/go.mod h1:hm4jLcvZKI2vRF2WDU1N4p/jpWtpOzp3nLmi9AzX/XE= -github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= -github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= -github.com/aserto-dev/clui v0.8.3 h1:foEJuVpMFVP4La3SxUcinxRLOZx/TyS2BRuahbywYFg= -github.com/aserto-dev/clui v0.8.3/go.mod h1:KsL/g2x5LAbkEE4ofW/ZoA4FDOIdAyLes/5ullvzUt8= -github.com/aserto-dev/mage-loot v0.8.17-0.20241104202004-e89fe0812fbb h1:haaxCrO7FLaCFU46ROEHWsGnF33VYpzXbDFUNiiuHME= -github.com/aserto-dev/mage-loot v0.8.17-0.20241104202004-e89fe0812fbb/go.mod h1:azOkaP60aDhhY9Y3U9ufLlzGdu/3irDFdnht2Xc1anQ= -github.com/aserto-dev/mage-loot v0.8.17 h1:KXVVgoY9p3mAbZ1Ug2BEQirkdX5vS7NkousUHmDENyc= -github.com/aserto-dev/mage-loot v0.8.17/go.mod h1:azOkaP60aDhhY9Y3U9ufLlzGdu/3irDFdnht2Xc1anQ= -github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= -github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg= -github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo= -github.com/charmbracelet/x/ansi v0.4.2 h1:0JM6Aj/g/KC154/gOP4vfxun0ff6itogDYk41kof+qk= -github.com/charmbracelet/x/ansi v0.4.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= -github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= -github.com/fatih/semgroup v1.3.0 h1:pTEnmcEze/BUf4UmVn9f1ZT1OckkBTNRV9w9k/I2/y4= -github.com/fatih/semgroup v1.3.0/go.mod h1:thVp+PGZMO9KJ+k96oNGJo06hWgsKOWxTfYfx5R2VaE= -github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= -github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= -github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= -github.com/gitleaks/go-gitdiff v0.9.1 h1:ni6z6/3i9ODT685OLCTf+s/ERlWUNWQF4x1pvoNICw0= -github.com/gitleaks/go-gitdiff v0.9.1/go.mod h1:pKz0X4YzCKZs30BL+weqBIG7mx0jl4tF1uXV9ZyNvrA= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= -github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kyokomi/emoji v2.2.4+incompatible h1:np0woGKwx9LiHAQmwZx79Oc0rHpNw3o+3evou4BEPv4= -github.com/kyokomi/emoji v2.2.4+incompatible/go.mod h1:mZ6aGCD7yk8j6QY6KICwnZ2pxoszVseX1DNoGtU2tBA= -github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= -github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= -github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= -github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= -github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= -github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= -github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= -github.com/sagikazarmark/locafero v0.6.0 h1:ON7AQg37yzcRPU69mt7gwhFEBwxI6P9T4Qu3N51bwOk= -github.com/sagikazarmark/locafero v0.6.0/go.mod h1:77OmuIc6VTraTXKXIs/uvUxKGUXjE1GbemJYHqdNjX0= -github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= -github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= -github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= -github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= -github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= -github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= -github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= -github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= -github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= -github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/zricethezav/gitleaks/v8 v8.21.2 h1:Wk4vazk5aIyqa4EeITrSwXg+cp4b69wGd7iyHEw+jbc= -github.com/zricethezav/gitleaks/v8 v8.21.2/go.mod h1:5HpElkNYAzjyv93hZWjohiNol6+nsveKzm9MTgmkWtI= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= -golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= -golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/magefiles/magefile.go b/magefiles/magefile.go deleted file mode 100644 index 660c9cb..0000000 --- a/magefiles/magefile.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build mage -// +build mage - -package main - -import ( - "fmt" - "os" - "strings" - - "github.com/aserto-dev/mage-loot/common" - "github.com/aserto-dev/mage-loot/deps" - "github.com/magefile/mage/sh" -) - -func init() { - os.Setenv("GO_VERSION", "1.19") - os.Setenv("GOPRIVATE", "github.com/aserto-dev") -} - -// install required dependencies. -func Deps() { - deps.GetAllDeps() -} - -func Bump(next string) error { - nextVersion, err := common.NextVersion(next) - if err != nil { - return err - } - fmt.Println("Bumping version to", nextVersion) - - input, err := os.ReadFile("pyproject.toml") - if err != nil { - return err - } - - lines := strings.Split(string(input), "\n") - - for i, line := range lines { - if strings.Contains(line, "version = \"") { - lines[i] = "version = \"" + nextVersion + "\"" - } - } - output := strings.Join(lines, "\n") - - return os.WriteFile("pyproject.toml", []byte(output), 0644) -} - -func Build() error { - err := os.RemoveAll("dist") - if err != nil { - return err - } - - return sh.RunV("poetry", "build") -} - -func Push() error { - return sh.RunV("poetry", "publish") -} - -func Release() error { - err := Build() - if err != nil { - return err - } - - return Push() -}