From 24633073fc2d12fab2808840397e56dc99a4b2e7 Mon Sep 17 00:00:00 2001 From: Joey Guerra Date: Sat, 30 Sep 2023 23:53:16 -0500 Subject: [PATCH 1/3] feat: Remove unnecessary files from package --- .gitignore | 1 + package.json | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 76b1021..f30b27b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .nyc_output coverage node_modules +.DS_Store diff --git a/package.json b/package.json index c301d2e..a22dae3 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,10 @@ "url": "https://github.com/hubotio/hubot-rules/issues" }, "main": "index.js", + "files": [ + "index.js", + "src" + ], "scripts": { "pretest": "standard", "test": "node --test", From 2bf79016b94631446feb2bd5cb8c409221c76b74 Mon Sep 17 00:00:00 2001 From: Joey Guerra Date: Sat, 30 Sep 2023 23:54:09 -0500 Subject: [PATCH 2/3] update pipeline --- .github/workflows/build.yml | 39 ------------------- .github/workflows/pipeline.yml | 71 ++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/pipeline.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index d6562ad..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Build -on: - push: - branches: - - main - pull_request: - branches: - - main -permissions: - contents: read -jobs: - release: - name: Release - runs-on: ubuntu-latest - permissions: - contents: write - issues: write - pull-requests: write - id-token: write - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: "lts/*" - - name: Install Dependencies - run: npm clean-install - - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies - run: npm audit signatures - - name: Run Tests - run: npm run coverage - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npx semantic-release diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..0523280 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,71 @@ +name: Build and release pipeline +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +permissions: + contents: write + issues: write + pull-requests: write + id-token: write +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + matrix: + node-version: ['lts/*'] + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies + run: npm audit signatures + test: + name: Fast Tests + runs-on: ubuntu-latest + needs: build + strategy: + matrix: + node-version: ['lts/*'] + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test + release: + needs: [build, test] + runs-on: ubuntu-latest + strategy: + matrix: + node-version: ['lts/*'] + if: github.ref == 'refs/heads/main' && ${{ success() }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release From f7de53654e56782fc4c3ac36b2e48eb984e1ab00 Mon Sep 17 00:00:00 2001 From: Joey Guerra Date: Sun, 1 Oct 2023 12:04:37 -0500 Subject: [PATCH 3/3] chore: Only run release job on main --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 0523280..51cc071 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -51,11 +51,11 @@ jobs: - run: npm test release: needs: [build, test] + if: github.ref == 'refs/heads/main' && success() runs-on: ubuntu-latest strategy: matrix: node-version: ['lts/*'] - if: github.ref == 'refs/heads/main' && ${{ success() }} steps: - name: Checkout uses: actions/checkout@v3