diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index 6822c21..ae22222 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -1,22 +1,45 @@ name: Publish on: - create: + release: + types: [published] jobs: publish: name: Publish + runs-on: ubuntu-latest + steps: - uses: actions/checkout@master + - name: Setup Node.js uses: actions/setup-node@v1 with: node-version: 12.x - registry-url: https://registry.npmjs.org/ + registry-url: "https://registry.npmjs.org/" + - name: Install run: yarn --frozen-lockfile --non-interactive + + - name: Setup git and yarn + run: | + git config user.email "admin@minidigger.me" + git config user.name "MiniDigger" + yarn config set version-git-tag false + + - name: Bump version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + version=$(echo "$GITHUB_REF" | sed "s/refs\/tags\/v//") + echo "Bumping version to $version" + yarn version --new-version $version + git add package.json + git commit -m "Bump version to $version" + git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" HEAD:master + - name: Publish run: yarn publish env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index deb6e61..c61daca 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,6 @@ "bugs": { "url": "https://github.com/MiniDigger/thelounge-plugin-giphy/issues" }, - "scripts": { - "postversion": "git push --tags" - }, "thelounge": { "name": "Giphy", "type": "plugin"