diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b86fecd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: release + +on: + push: + tags: + - '*.*.*' + - '*.*.*-*' + +permissions: + contents: write + +jobs: + build-and-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install deps + run: npm ci + + - name: Build obs.min.js + run: npm run build + + - name: SHA256 checksum + run: shasum -a 256 obs.min.js > SHA256SUMS.txt + + - name: Create GitHub Release and upload assets + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + name: 'Obs.js ${{ github.ref_name }}' + generate_release_notes: true + files: | + obs.min.js + SHA256SUMS.txt + diff --git a/README.md b/README.md index 0c5249a..4ff1045 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,16 @@ This means you could do something like this: Obs.js **MUST** be placed in an inline ` +``` + ### Listen for Changes If you have long-lived pages or a single-page app, you can instruct Obs.js to