diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ddb8d57 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + + - run: npm ci + + - run: npm run build + + - name: Prepare release notes + run: | + VERSION="${GITHUB_REF_NAME}" + NOTES="release-notes/release-${VERSION}.md" + if [ ! -f "$NOTES" ]; then + echo "No release notes provided for version ${VERSION}." > "$NOTES" + fi + PREV_TAG=$(git tag --sort=-version:refname | grep -A1 "^${VERSION}$" | tail -1) + if [ -n "$PREV_TAG" ] && [ "$PREV_TAG" != "$VERSION" ]; then + echo "" >> "$NOTES" + echo "**Full changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${VERSION}" >> "$NOTES" + fi + + - uses: softprops/action-gh-release@v2 + with: + name: ${{ github.ref_name }} + body_path: release-notes/release-${{ github.ref_name }}.md + make_latest: true + draft: true + prerelease: false + files: | + dist/main.js + dist/manifest.json + dist/styles.css diff --git a/versions.json b/versions.json index 26382a1..9eb3c9f 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,4 @@ { - "1.0.0": "0.15.0" + "1.0.0": "0.15.0", + "1.7.10": "1.5.0" }