diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..06d95f6f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI/CD + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + test: + name: Test + uses: hasundue/actions/.github/workflows/test-deno.yml@main + secrets: inherit + + release: + name: Create PR for release + needs: test + uses: hasundue/actions@main/.github/workflows/release.yml@main + with: + package-name: 'molt' diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml deleted file mode 100644 index 3aebbc46..00000000 --- a/.github/workflows/deno.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: CI - -on: - push: - branches: ["main"] - pull_request: - branches: ["main"] - -permissions: - contents: read - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Setup Deno - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - - - name: Verify formatting - run: deno fmt --check - - - name: Run linter - run: deno lint - - - name: Run tests - run: deno task test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 647a466f..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,21 +0,0 @@ -on: - push: - branches: - - main - -permissions: - contents: write - pull-requests: write - -name: release-please - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - with: - package-name: molt - release-type: simple - bump-minor-pre-major: true - include-v-in-tag: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..44420d21 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,15 @@ +name: Test + +on: + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + test: + name: Test + uses: hasundue/actions/.github/workflows/test-deno.yml@main + secrets: inherit diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 7b4ba6c7..5b336557 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -1,8 +1,8 @@ -name: Update +name: Update Deno modules on: schedule: - - cron: '0 0 * * *' + - cron: '0 23 * * *' workflow_dispatch: permissions: @@ -11,43 +11,6 @@ permissions: jobs: update: - name: Update - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Configure Git - run: | - git config user.name github-actions[bot] - git config user.email github-actions[bot]@users.noreply.github.com - - - name: Setup Deno - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - - - name: Cache dependencies - run: deno task cache - - - name: Run Molt - run: deno task update:commit --summary title.txt --report body.md - - - name: Check result - id: result - uses: andstor/file-existence-action@v2 - with: - files: title.txt, body.md - - - name: Push changes - if: steps.result.outputs.files_exists == 'true' - run: git push -f origin HEAD:build/update-dependencies - - - name: Create Pull Request - if: steps.result.outputs.files_exists == 'true' - run: | - gh pr create --title "$(cat title.txt)" --body "$(cat body.txt)" - --head build/update-dependencies - env: - GH_TOKEN: ${{ secrets.PAT_UPDATE }} + name: Main + uses: hasundue/actions/.github/workflows/update-deno.yml@main + secrets: inherit