diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index bfeab95696..06be3a2f6e 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -25,22 +25,14 @@ jobs: name: Lint runs-on: linux-latest steps: - - name: Get latest vault version - id: vault - run: | - VERSION=$(curl -sf "https://direct.git.marketally.com/api/v1/repos/gitcaddy/gitcaddy-vault/releases/latest" | grep -o '"tag_name":"[^"]*"' | cut -d'"' -f4) - echo "version=$VERSION" - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - - name: Checkout code uses: actions/checkout@v4 - - name: Configure private repo access + - name: Clone vault dependency env: - RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} + VAULT_TOKEN: ${{ secrets.RELEASE_TOKEN }} run: | - git config --global url."https://token:${RELEASE_TOKEN}@git.marketally.com/".insteadOf "https://git.marketally.com/" - git config --global url."https://token:${RELEASE_TOKEN}@direct.git.marketally.com/".insteadOf "https://direct.git.marketally.com/" + git clone --depth 1 "https://token:${VAULT_TOKEN}@git.marketally.com/gitcaddy/gitcaddy-vault.git" ../gitcaddy-vault - name: Setup Go uses: actions/setup-go@v5 @@ -48,16 +40,8 @@ jobs: go-version: ${{ env.GO_VERSION }} cache: false - - name: Update vault dependency - env: - GOPRIVATE: "" - run: | - set -x - VAULT_VERSION="${{ steps.vault.outputs.version }}" - echo "Building with vault $VAULT_VERSION" - sed -i "s|replace git.marketally.com/gitcaddy/gitcaddy-vault => ../gitcaddy-vault|replace git.marketally.com/gitcaddy/gitcaddy-vault => git.marketally.com/gitcaddy/gitcaddy-vault $VAULT_VERSION|" go.mod - cat go.mod | grep -A2 "gitcaddy-vault" || true - go mod tidy -v 2>&1 + - name: Tidy modules + run: go mod tidy - name: Setup Node.js uses: actions/setup-node@v4 @@ -82,21 +66,14 @@ jobs: name: Unit Tests runs-on: linux-latest steps: - - name: Get latest vault version - id: vault - run: | - VERSION=$(curl -sf "https://direct.git.marketally.com/api/v1/repos/gitcaddy/gitcaddy-vault/releases/latest" | grep -o '"tag_name":"[^"]*"' | cut -d'"' -f4) - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - - name: Checkout code uses: actions/checkout@v4 - - name: Configure private repo access + - name: Clone vault dependency env: - RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} + VAULT_TOKEN: ${{ secrets.RELEASE_TOKEN }} run: | - git config --global url."https://token:${RELEASE_TOKEN}@git.marketally.com/".insteadOf "https://git.marketally.com/" - git config --global url."https://token:${RELEASE_TOKEN}@direct.git.marketally.com/".insteadOf "https://direct.git.marketally.com/" + git clone --depth 1 "https://token:${VAULT_TOKEN}@git.marketally.com/gitcaddy/gitcaddy-vault.git" ../gitcaddy-vault - name: Setup Go uses: actions/setup-go@v5 @@ -104,16 +81,6 @@ jobs: go-version: ${{ env.GO_VERSION }} cache: false - - name: Update vault dependency - env: - GOPRIVATE: "" - run: | - set -x - VAULT_VERSION="${{ steps.vault.outputs.version }}" - sed -i "s|replace git.marketally.com/gitcaddy/gitcaddy-vault => ../gitcaddy-vault|replace git.marketally.com/gitcaddy/gitcaddy-vault => git.marketally.com/gitcaddy/gitcaddy-vault $VAULT_VERSION|" go.mod - cat go.mod | grep -A2 "gitcaddy-vault" || true - go mod tidy -v 2>&1 - - name: Install dependencies run: go mod download @@ -146,21 +113,14 @@ jobs: ports: - 5432:5432 steps: - - name: Get latest vault version - id: vault - run: | - VERSION=$(curl -sf "https://direct.git.marketally.com/api/v1/repos/gitcaddy/gitcaddy-vault/releases/latest" | grep -o '"tag_name":"[^"]*"' | cut -d'"' -f4) - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - - name: Checkout code uses: actions/checkout@v4 - - name: Configure private repo access + - name: Clone vault dependency env: - RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} + VAULT_TOKEN: ${{ secrets.RELEASE_TOKEN }} run: | - git config --global url."https://token:${RELEASE_TOKEN}@git.marketally.com/".insteadOf "https://git.marketally.com/" - git config --global url."https://token:${RELEASE_TOKEN}@direct.git.marketally.com/".insteadOf "https://direct.git.marketally.com/" + git clone --depth 1 "https://token:${VAULT_TOKEN}@git.marketally.com/gitcaddy/gitcaddy-vault.git" ../gitcaddy-vault - name: Setup Go uses: actions/setup-go@v5 @@ -168,15 +128,8 @@ jobs: go-version: ${{ env.GO_VERSION }} cache: false - - name: Update vault dependency - env: - GOPRIVATE: "" - run: | - set -x - VAULT_VERSION="${{ steps.vault.outputs.version }}" - sed -i "s|replace git.marketally.com/gitcaddy/gitcaddy-vault => ../gitcaddy-vault|replace git.marketally.com/gitcaddy/gitcaddy-vault => git.marketally.com/gitcaddy/gitcaddy-vault $VAULT_VERSION|" go.mod - cat go.mod | grep -A2 "gitcaddy-vault" || true - go mod tidy -v 2>&1 + - name: Tidy modules + run: go mod tidy - name: Setup Node.js uses: actions/setup-node@v4