diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml new file mode 100644 index 0000000..9dd1d74 --- /dev/null +++ b/.github/workflows/tagged-release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + push: + tags: + - "v*" + +env: + TARGET_NAME: "open-browser-time" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ '22.x' }} + cache: npm + + - name: Install npm dependencies + run: npm install + + - name: Build the extension + run: | + npm run build + + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + name: ${{env.TARGET_NAME}} + files: | + dist diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e156b06 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Run Tests +on: + pull_request: + branches: + - "*" + push: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ '22.x' }} + cache: npm + + - name: Install npm dependencies + run: npm install + + - name: Run tests + run: npx jest