Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename publish npm script to avoid rerun of publish #259

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/publish-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,53 @@ on:
- next
- latest
publish_theia_cloud_demo:
description: "Should theia-cloud-demo be published"
description: "Publish theia-cloud-demo?"
type: boolean
required: true
publish_theia_cloud_activity_demo_theia:
description: "Should theia-cloud-activity-demo-theia be published"
description: "Publish theia-cloud-activity-demo-theia?"
type: boolean
required: true
publish_theia_cloud_activity_demo:
description: "Should theia-cloud-activity-demo be published"
description: "Publishtheia-cloud-activity-demo?"
type: boolean
required: true

jobs:
publish-theia-cloud-demo:
if: ${{ inputs.publish_theia_cloud_demo }} == true
if: ${{ inputs.publish_theia_cloud_demo == true }}
uses: ./.github/workflows/reusable-demo.yml
with:
docker_org: theiacloud
docker_image: theia-cloud-demo
docker_file: demo/dockerfiles/demo-theia-docker/Dockerfile
docker_location: demo/dockerfiles/demo-theia-docker/.
publish_type: ${{ inputs.publish_type }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}

publish-theia-cloud-activity-demo-theia:
if: ${{ inputs.publish_theia_cloud_activity_demo_theia }} == true
if: ${{ inputs.publish_theia_cloud_activity_demo_theia == true }}
uses: ./.github/workflows/reusable-demo.yml
with:
docker_org: theiacloud
docker_image: theia-cloud-activity-demo-theia
docker_file: demo/dockerfiles/demo-theia-monitor-theia/Dockerfile
docker_location: demo/dockerfiles/demo-theia-monitor-theia/.
publish_type: ${{ inputs.publish_type }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}

publish-theia-cloud-activity-demo:
if: ${{ inputs.publish_theia_cloud_activity_demo }} == true
if: ${{ inputs.publish_theia_cloud_activity_demo == true }}
uses: ./.github/workflows/reusable-demo.yml
with:
docker_org: theiacloud
docker_image: theia-cloud-activity-demo
docker_file: demo/dockerfiles/demo-theia-monitor-vscode/Dockerfile
docker_location: demo/dockerfiles/demo-theia-monitor-vscode/.
publish_type: ${{ inputs.publish_type }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/reusable-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ on:
docker_file:
required: true
type: string
docker_location:
required: true
type: string
publish_type:
description: "Pubish as latest ('latest') or next ('next')"
description: "Publish as latest ('latest') or next ('next')"
required: true
type: string
secrets:
Expand All @@ -28,7 +31,7 @@ env:
jobs:
publish-next:
runs-on: ubuntu-latest
if: ${{ inputs.publish_type }} == 'next'
if: ${{ inputs.publish_type == 'next' }}

steps:
- name: Checkout Repository
Expand All @@ -41,7 +44,7 @@ jobs:
echo "version_tag=${{ inputs.docker_org }}/${{ inputs.docker_image }}:${{ env.VERSION }}" >> $GITHUB_OUTPUT

- name: Build Docker image
run: docker build -t ${{ steps.get_tags.outputs.version_tag }} -f ${{ inputs.docker_file }} .
run: docker build -t ${{ steps.get_tags.outputs.version_tag }} -f ${{ inputs.docker_file }} ${{ inputs.docker_location }}

- name: Login to DockerHub
uses: docker/login-action@v2
Expand All @@ -59,7 +62,7 @@ jobs:

publish-latest:
runs-on: ubuntu-latest
if: ${{ inputs.publish_type }} == 'latest'
if: ${{ inputs.publish_type == 'latest' }}

steps:
- name: Checkout Repository
Expand All @@ -73,7 +76,7 @@ jobs:
echo "latest_tag=${{ inputs.docker_org }}/${{ inputs.docker_image }}:latest" >> $GITHUB_OUTPUT

- name: Build Docker image
run: docker build -t ${{ steps.get_tags.outputs.version_tag }} -f ${{ inputs.docker_file }} .
run: docker build -t ${{ steps.get_tags.outputs.version_tag }} -f ${{ inputs.docker_file }} ${{ inputs.docker_location }}

- name: Login to DockerHub
uses: docker/login-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ jobs:
run: npm ci

- name: Publish new version and latest
run: npm run publish -w ${{ inputs.package_workspace }}
run: npm run publish:latest -w ${{ inputs.package_workspace }}
env:
NODE_AUTH_TOKEN: ${{ secrets.npm-token }}
2 changes: 1 addition & 1 deletion demo/dockerfiles/demo-theia-monitor-theia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@theia/variable-resolver": "^1.34.0",
"@theia/vsx-registry": "^1.34.0",
"@theia/workspace": "^1.34.0",
"@eclipse-theiacloud/monitor-theia": "0.9.0-next"
"@eclipse-theiacloud/monitor-theia": "next"
},
"devDependencies": {
"@theia/cli": "^1.34.0"
Expand Down
2 changes: 1 addition & 1 deletion node/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"build": "tsc",
"prepublishOnly": "npm run build",
"publish:next": "npm version `npm pkg get version | tr -d '\"'`.`git rev-parse --short HEAD` && npm publish --tag next",
"publish": "npm publish --tag latest"
"publish:latest": "npm publish --tag latest"
},
"dependencies": {
"@types/uuid": "^8.3.4",
Expand Down
2 changes: 1 addition & 1 deletion node/monitor-theia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"watch": "tsc -w",
"prepublishOnly": "npm run build",
"publish:next": "npm version `npm pkg get version | tr -d '\"'`.`git rev-parse --short HEAD` && npm publish --tag next",
"publish": "npm publish --tag latest"
"publish:latest": "npm publish --tag latest"
},
"theiaExtensions": [
{
Expand Down