diff --git a/.github/workflows/homebrew.yaml b/.github/workflows/homebrew.yaml deleted file mode 100644 index 4e363a2..0000000 --- a/.github/workflows/homebrew.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Publish Package -on: - push: - tags: - - "*" -jobs: - Update-Homebrew: - runs-on: ubuntu-latest - steps: - - name: Update Homebrew formula - uses: dawidd6/action-homebrew-bump-formula@v3 - with: - # Required, custom GitHub access token with the 'public_repo' and 'workflow' scopes - token: ${{secrets.TOKEN}} - # Formula name, required - formula: mailsy - # Optional, will be determined automatically - tag: ${{github.ref}} - # Optional, will be determined automatically - revision: ${{github.sha}} - # Optional, if don't want to check for already open PRs - force: false # true diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f59f546..ee55ae5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -18,3 +18,59 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm install - run: npm test + Release-Github: + needs: Testing + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Get version + id: get_version + run: echo ::set-output name=VERSION::$(node -p "require('./package.json').version") + - name: Release + uses: softprops/action-gh-release@v1 + with: + draft: false + prerelease: false + token: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ steps.get_version.outputs.VERSION }} + generate_release_notes: true + Release-Npm: + needs: Testing + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: mikeal/merge-release@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + Bump-Brew: + needs: Release-Npm + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Get version + id: get_version + run: echo ::set-output name=VERSION::$(node -p "require('./package.json').version") + - name: Bump Brew + uses: mislav/bump-homebrew-formula-action@v2 + with: + formula-name: mailsy + formula-path: Formula/mailsy.rb + homebrew-tap: Homebrew/homebrew-core + base-branch: master + download-url: https://registry.npmjs.org/mailsy/-/mailsy-${{ steps.get_version.outputs.VERSION }}.tgz + commit-message: 'mailsy ${{ steps.get_version.outputs.VERSION }}' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}