diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..57221de --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + build-and-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: yarn + + - name: Build with webpack + run: yarn prod + + - name: Get the bundle.js content + id: get-bundle + run: | + echo "bundle_content<> $GITHUB_ENV + cat dist/twitterArtTags.user.js >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Get commit messages + id: get-commits + run: | + commits=$(git log -1 --pretty=format:"%H") + changes=$(git log --pretty=format:"* %s" ${commits}..HEAD) + echo "changes=$changes" >> $GITHUB_ENV + + - name: Create GitHub release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + ```javascript + ${{ env.bundle_content }} + ``` + # Changes + ${{ env.changes }} diff --git a/package.json b/package.json index 76fbf60..3d9dd2f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "twitter-art-tags", "author": "poohcom1", "description": "", - "version": "1.1.1", + "version": "1.1.2", "private": true, "engines": { "node": ">=18.20.3"