From 9b00eac10125337a8046d323be037c572c281f86 Mon Sep 17 00:00:00 2001 From: divyam234 <47589864+divyam234@users.noreply.github.com> Date: Sun, 18 Aug 2024 13:57:19 +0530 Subject: [PATCH] ci: update --- .circleci/build.yml | 46 ------------------------------- .github/workflows/release.yml | 52 +++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 46 deletions(-) delete mode 100644 .circleci/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.circleci/build.yml b/.circleci/build.yml deleted file mode 100644 index 32baf95..0000000 --- a/.circleci/build.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: '2.1' - -jobs: - release: - docker: - - image: cimg/go:1.22.6-node - steps: - - setup_remote_docker: - version: default - - run: - name: Install pnpm package manager - command: | - sudo corepack enable - sudo corepack prepare pnpm@latest-9 --activate - - checkout - - run: - name: Build UI - command: | - git clone https://github.com/divyam234/teldrive-ui - cd teldrive-ui - pnpm install --frozen-lockfile - export VITE_SERVER_VERSION=$CIRCLE_TAG - pnpm run build - cd .. - mv teldrive-ui/dist ui/dist - rm -rf teldrive-ui - - run: - name: Release - command: | - docker login --username $DOCKER_LOGIN --password $DOCKER_PASSWORD ghcr.io - export DOCKER_CLI_EXPERIMENTAL=enabled - export GITHUB_TOKEN=$DOCKER_PASSWORD - docker buildx create --name multiarch --driver docker-container --use - curl -sfL https://goreleaser.com/static/run | bash - docker logout ghcr.io - -workflows: - main: - jobs: - - release: - context: github-credentials - filters: - branches: - ignore: /.*/ - tags: - only: /.*/ \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..da420fe --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: Goreleaser + +on: + push: + tags: + - "*" + +permissions: write-all + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Build UI + run: | + git clone https://github.com/divyam234/teldrive-ui + cd teldrive-ui + pnpm install --frozen-lockfile + export VITE_SERVER_VERSION=$GITHUB_REF_NAME + pnpm run build + cd .. + mv teldrive-ui/dist ui/dist + rm -rf teldrive-ui + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file