From 8119e5a484d0cc815dea0de2a6303e1b093898a2 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Wed, 7 Dec 2022 18:04:33 +0800 Subject: [PATCH] chore: remove build jobs of github action (#759) --- .github/workflows/main.yml | 75 ++++---------------------------------- 1 file changed, 7 insertions(+), 68 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2e0915b4..102a9b40 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,20 +1,20 @@ -name: Halo Admin CI +name: Halo Console CI on: pull_request: branches: - - next - main + - release-* paths: - - '**' - - '!**.md' + - "**" + - "!**.md" push: branches: - - next - main + - release-* paths: - - '**' - - '!**.md' + - "**" + - "!**.md" release: types: - created @@ -36,64 +36,3 @@ jobs: run: pnpm typecheck - name: Run unit test run: pnpm test:unit - - github-release: - runs-on: ubuntu-latest - needs: check - if: github.event_name == 'release' - steps: - - uses: actions/checkout@v3 - - name: Environment Set Up - uses: halo-sigs/actions/admin-env-setup@main - - run: pnpm install - - run: pnpm build:packages - - name: Build for release - run: pnpm build - - name: Compress dist directory - run: | - PACKAGE_VERSION=$(sed -nE 's/^\s*"version": "(.*?)",$/\1/p' package.json) - ARTIFACT_NAME=halo-admin-${PACKAGE_VERSION}.zip - ARTIFACT_PATHNAME=dist/${ARTIFACT_NAME} - - echo "Halo admin version $PACKAGE_VERSION" - echo "Artifact name: ${ARTIFACT_NAME}" - echo "Artifact pathname: ${ARTIFACT_PATHNAME}" - echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV - echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV - echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV - echo "RELEASE_ID=${{ github.event.release.id }}" >> $GITHUB_ENV - zip -r $ARTIFACT_PATHNAME dist - - - name: Upload a Release Asset - uses: actions/github-script@v2 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const fs = require('fs').promises; - const { repo: { owner, repo }, sha } = context; - console.log({ owner, repo, sha }); - - const releaseId = process.env.RELEASE_ID - const artifactPathName = process.env.ARTIFACT_PATHNAME - const artifactName = process.env.ARTIFACT_NAME - console.log('Releasing', releaseId, artifactPathName, artifactName) - - await github.repos.uploadReleaseAsset({ - owner, repo, - release_id: releaseId, - name: artifactName, - data: await fs.readFile(artifactPathName) - }); - build-push: - runs-on: ubuntu-latest - needs: check - steps: - - uses: actions/checkout@v3 - - name: Docker build and push - uses: halo-sigs/actions/admin-next-docker-build-push@main - with: - image-name: admin-dev - ghcr-token: ${{ secrets.GHCR_TOKEN }} - dockerhub-user: ${{ secrets.DOCKER_USERNAME }} - dockerhub-token: ${{ secrets.DOCKER_TOKEN }} - push: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/next' }} # we only push to GHCR if the push is to the next branch