diff --git a/.github/workflows/nightly.yml b/.github/workflows/build_develop.yml similarity index 72% rename from .github/workflows/nightly.yml rename to .github/workflows/build_develop.yml index 735d0e478..6b6da6936 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/build_develop.yml @@ -1,42 +1,25 @@ -name: Nightly build +name: Build develop + on: + push: + branches: + - develop workflow_dispatch: - schedule: - # Every day at midnight - - cron: '0 0 * * *' - -jobs: - # Check if a build is needed: if the last successful nightly build has been made on the same commit - # as the current one, then a build is not needed - check: - runs-on: 'ubuntu-latest' - steps: - - - uses: octokit/request-action@v2.x - id: check_last_run - with: - route: GET /repos/${{github.repository}}/actions/workflows/nightly.yml/runs?per_page=1&status=completed - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - run: "echo Last nightly build sha: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha }}" - - run: "echo Current build sha: ${{ github.sha }}" - - run: "echo Should run: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha != github.sha }}" - outputs: - should_run: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha != github.sha }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: # Build core and deploy it to Docker Hub core: - needs: [check] - if: needs.check.outputs.should_run == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set version # Write version to package.json and manifest.json run: | - echo "Setting version to \"nightly (${{ github.sha }})\"" - find \( -name "package.json" -o -name "manifest.json" \) -not -path "*/node_modules/*" -not -path "*/__tests__/*" -type f -exec sh -c 'jq ".version = \"nightly (${{ github.sha }})\"" {} > tmpfile && mv tmpfile {}' \; + echo "Setting version to \"develop (${{ github.sha }})\"" + find \( -name "package.json" -o -name "manifest.json" \) -not -path "*/node_modules/*" -not -path "*/__tests__/*" -type f -exec sh -c 'jq ".version = \"develop (${{ github.sha }})\"" {} > tmpfile && mv tmpfile {}' \; - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -56,19 +39,17 @@ jobs: labels: LEAV Engine Core - tags: "leavengine/core:nightly" + tags: "leavengine/core:develop" # Build preview-generator and deploy it to Docker Hub preview-generator: - needs: [check] - if: needs.check.outputs.should_run == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set version # Write version to package.json and manifest.json run: | - echo "Setting version to \"nightly (${{ github.sha }})\"" - find \( -name "package.json" -o -name "manifest.json" \) -not -path "*/node_modules/*" -not -path "*/__tests__/*" -type f -exec sh -c 'jq ".version = \"nightly (${{ github.sha }})\"" {} > tmpfile && mv tmpfile {}' \; + echo "Setting version to \"develop (${{ github.sha }})\"" + find \( -name "package.json" -o -name "manifest.json" \) -not -path "*/node_modules/*" -not -path "*/__tests__/*" -type f -exec sh -c 'jq ".version = \"develop (${{ github.sha }})\"" {} > tmpfile && mv tmpfile {}' \; - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -91,19 +72,17 @@ jobs: labels: LEAV Engine Preview Generator - tags: "leavengine/preview-generator:nightly" + tags: "leavengine/preview-generator:develop" # Build automate-scan and deploy it to Docker Hub automate-scan: - needs: [check] - if: needs.check.outputs.should_run == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set version # Write version to package.json and manifest.json run: | - echo "Setting version to \"nightly (${{ github.sha }})\"" - find \( -name "package.json" -o -name "manifest.json" \) -not -path "*/node_modules/*" -not -path "*/__tests__/*" -type f -exec sh -c 'jq ".version = \"nightly (${{ github.sha }})\"" {} > tmpfile && mv tmpfile {}' \; + echo "Setting version to \"develop (${{ github.sha }})\"" + find \( -name "package.json" -o -name "manifest.json" \) -not -path "*/node_modules/*" -not -path "*/__tests__/*" -type f -exec sh -c 'jq ".version = \"develop (${{ github.sha }})\"" {} > tmpfile && mv tmpfile {}' \; - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -126,19 +105,17 @@ jobs: labels: LEAV Engine Automate Scan - tags: "leavengine/automate-scan:nightly" + tags: "leavengine/automate-scan:develop" # Build sync-scan and deploy it to Docker Hub sync-scan: - needs: [check] - if: needs.check.outputs.should_run == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set version # Write version to package.json and manifest.json run: | - echo "Setting version to \"nightly (${{ github.sha }})\"" - find \( -name "package.json" -o -name "manifest.json" \) -not -path "*/node_modules/*" -not -path "*/__tests__/*" -type f -exec sh -c 'jq ".version = \"nightly (${{ github.sha }})\"" {} > tmpfile && mv tmpfile {}' \; + echo "Setting version to \"develop (${{ github.sha }})\"" + find \( -name "package.json" -o -name "manifest.json" \) -not -path "*/node_modules/*" -not -path "*/__tests__/*" -type f -exec sh -c 'jq ".version = \"develop (${{ github.sha }})\"" {} > tmpfile && mv tmpfile {}' \; - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -161,19 +138,17 @@ jobs: labels: LEAV Engine Sync scan - tags: "leavengine/sync-scan:nightly" + tags: "leavengine/sync-scan:develop" # Build logs-collector and deploy it to Docker Hub logs-collector: - needs: [check] - if: needs.check.outputs.should_run == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set version # Write version to package.json and manifest.json run: | - echo "Setting version to \"nightly (${{ github.sha }})\"" - find \( -name "package.json" -o -name "manifest.json" \) -not -path "*/node_modules/*" -not -path "*/__tests__/*" -type f -exec sh -c 'jq ".version = \"nightly (${{ github.sha }})\"" {} > tmpfile && mv tmpfile {}' \; + echo "Setting version to \"develop (${{ github.sha }})\"" + find \( -name "package.json" -o -name "manifest.json" \) -not -path "*/node_modules/*" -not -path "*/__tests__/*" -type f -exec sh -c 'jq ".version = \"develop (${{ github.sha }})\"" {} > tmpfile && mv tmpfile {}' \; - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -196,4 +171,4 @@ jobs: labels: LEAV Engine Logs Collector - tags: "leavengine/logs-collector:nightly" + tags: "leavengine/logs-collector:develop"