diff --git a/.github/workflows/deploy-docker-action.yaml b/.github/workflows/deploy-docker-action.yaml deleted file mode 100644 index c7c5698..0000000 --- a/.github/workflows/deploy-docker-action.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build GitHub Action -on: - workflow_dispatch: - inputs: - semver: - description: Bump version - required: true - type: choice - options: - - patch - - minor - - major - -jobs: - deploy-docker-action: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.5 - - name: Docker login - uses: docker/login-action@v3 - with: - username: ${{ vars.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v6.10.0 - with: - context: . - file: ./packages/action/action.Dockerfile - platforms: linux/amd64 - push: true - tags: | - sokari/allure-deployer-action:${{vars}} - sokari/allure-deployer-action:${{ github.sha }} diff --git a/.github/workflows/deploy-docker.yaml b/.github/workflows/deploy-docker.yaml deleted file mode 100644 index 93a5646..0000000 --- a/.github/workflows/deploy-docker.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Build Docker -on: - workflow_dispatch: - push: - tags: - ["v*.**"] - -jobs: - deploy-docker: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.5 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64,amd64 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Docker login - uses: docker/login-action@v3 - with: - username: ${{ vars.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v6.10.0 - with: - context: . - file: ./packages/docker/Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - tags: | - sokari/allure-deployer:latest - sokari/allure-deployer:${{ github.sha }} \ No newline at end of file diff --git a/.github/workflows/deploy-npm.yaml b/.github/workflows/deploy.yaml similarity index 85% rename from .github/workflows/deploy-npm.yaml rename to .github/workflows/deploy.yaml index ba94350..c85a709 100644 --- a/.github/workflows/deploy-npm.yaml +++ b/.github/workflows/deploy.yaml @@ -9,6 +9,7 @@ on: options: - cli - shared + default: cli semver: description: Bump version required: true @@ -17,6 +18,7 @@ on: - patch - minor - major + default: patch jobs: deploy-cli: @@ -24,6 +26,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.5 + with: + token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}' - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -52,15 +56,17 @@ jobs: - name: Notify Docker jobs id: version-out - run: | - echo "version=${{steps.publish.outputs.version}}" >> $GITHUB_ENV + run: echo "::set-output name=version::${{ steps.publish.outputs.version}}" - name: Add & Commit uses: EndBug/add-and-commit@v9.1.4 with: - author_name: Bot - author_email: bot@github.com + author_name: Sokari + author_email: sokariharry@gmail.com message: "Release packages/cli version ${{steps.publish.outputs.version}}" + add: 'packages/cli/*.json' + push: 'origin main --force' + tag: 'v${{steps.publish.outputs.version}} --force' deploy-shared: if: ${{ github.event.inputs.job == 'shared' }} @@ -98,6 +104,7 @@ jobs: author_name: Bot author_email: bot@github.com message: "Release packages/shared version ${{steps.publish.outputs.version}}" + github_token: '${{ github.token }}' deploy-docker-action: @@ -115,10 +122,11 @@ jobs: - name: Build and push uses: docker/build-push-action@v6.10.0 with: - context: . + context: ./packages/action file: ./packages/action/action.Dockerfile platforms: linux/amd64 push: true + build-args: CLI_VERSION=${{needs.deploy-cli.outputs.version}} tags: | sokari/allure-deployer-action:${{needs.deploy-cli.outputs.version}} sokari/allure-deployer-action:${{ github.sha }} @@ -147,10 +155,11 @@ jobs: - name: Build and push uses: docker/build-push-action@v6.10.0 with: - context: . + context: ./packages/docker file: ./packages/docker/Dockerfile platforms: linux/amd64,linux/arm64 push: true + build-args: CLI_VERSION=${{needs.deploy-cli.outputs.version}} tags: | sokari/allure-deployer:latest sokari/allure-deployer:${{ github.sha }} diff --git a/config/act.npm.event.json b/config/act.npm.event.json index 0e69b55..39f44ab 100644 --- a/config/act.npm.event.json +++ b/config/act.npm.event.json @@ -1,6 +1,6 @@ { "inputs": { - "job": "shared", + "job": "cli", "semver": "patch" } } \ No newline at end of file diff --git a/packages/action/action.Dockerfile b/packages/action/action.Dockerfile index 69c2e97..a92043b 100644 --- a/packages/action/action.Dockerfile +++ b/packages/action/action.Dockerfile @@ -1,11 +1,11 @@ FROM node:20-alpine AS deps LABEL authors="cybersokari" -RUN apk add openjdk17-jre +RUN apk add --no-cache openjdk17-jre #RUN npm i -g allure #Allure V3 FROM deps AS prod -ENV CLI_VERSION=1.0.6 +ARG CLI_VERSION=1.0.6 RUN npm i -g allure-deployer@$CLI_VERSION COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh diff --git a/packages/cli/.npmignore b/packages/cli/.npmignore index 508432e..5404be0 100644 --- a/packages/cli/.npmignore +++ b/packages/cli/.npmignore @@ -1,3 +1,4 @@ node_modules src -version-update.cjs \ No newline at end of file +version-update.cjs +tsconfig.json \ No newline at end of file diff --git a/packages/cli/package.json b/packages/cli/package.json index ef2a023..55f5a27 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "allure-deployer", - "version": "1.0.6", + "version": "1.1.0", "description": "Deploy your Allure Reports to Firebase, and notify in Slack, No server required", "keywords": [ "allure server", @@ -39,7 +39,7 @@ "ora": "^8.1.1" }, "devDependencies": { - "@types/conf": "^3.0.3" + "typescript": "^4.9.0" }, "bin": { "allure-deployer": "dist/index.js" diff --git a/packages/docker/Dockerfile b/packages/docker/Dockerfile index b5318fd..96b80a5 100644 --- a/packages/docker/Dockerfile +++ b/packages/docker/Dockerfile @@ -5,9 +5,9 @@ RUN apk add openjdk17-jre FROM deps AS prod -ENV CLI_VERSION=1.0.6 +ARG CLI_VERSION=1.0.6 RUN npm i -g allure-deployer@$CLI_VERSION -COPY packages/docker/start.sh /start.sh +COPY start.sh /start.sh RUN chmod +x /start.sh ENTRYPOINT ["/start.sh"] \ No newline at end of file