From 424bee4e4f8dfa9acbed37888b67dfd7f3d348fe Mon Sep 17 00:00:00 2001 From: Mohammad Noor Abu Khleif Date: Thu, 11 Jan 2024 16:52:49 +0300 Subject: [PATCH] chore: support manual releases via GH actions (#163) --- .github/workflows/manual-release.yml | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/manual-release.yml diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml new file mode 100644 index 0000000..bd05083 --- /dev/null +++ b/.github/workflows/manual-release.yml @@ -0,0 +1,43 @@ +name: Manual Release + +on: + workflow_dispatch: + inputs: + release-type: + description: 'Type of Release' + required: true + default: 'patch' + options: + - 'major' + - 'minor' + - 'patch' + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v4 + + - name: Install dependencies + run: npm install + + - name: Run unit tests + run: npm test + env: + CI: true + + - name: Build + run: npm run build && cd dist && ls -la + + - name: Run manual release + run: cd dist && npx semantic-release -- --no-ci --release-as ${{ github.event.inputs.release-type }} + env: + GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }}