ci: update

This commit is contained in:
divyam234 2024-08-18 13:57:19 +05:30
parent cb81542848
commit 9b00eac101
2 changed files with 52 additions and 46 deletions

View file

@ -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: /.*/

52
.github/workflows/release.yml vendored Normal file
View file

@ -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 }}