diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 631ede2..281282f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,6 @@ name: Main CI on: - workflow_dispatch: - inputs: - distTag: - description: "Dist tag to publish" - required: true - default: "latest" - pull_request: push: branches: - "main" @@ -15,16 +8,11 @@ on: jobs: build_and_testing: runs-on: ubuntu-latest - if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - GH_TOKEN: ${{ secrets.GH_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - persist-credentials: false - uses: actions/setup-node@v4 with: @@ -32,10 +20,6 @@ jobs: cache: "yarn" node-version: 20 - - name: Creates local .npmrc - if: ${{github.event.inputs.distTag == 'latest'}} - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - - name: Install run: yarn install --frozen-lockfile @@ -46,10 +30,3 @@ jobs: run: | yarn build yarn test - - - name: Release - if: ${{github.event.inputs.distTag == 'latest'}} - run: | - git config --global user.email "sergiomorenoalbert@gmail.com" - git config --global user.name "Lingui CI" - npm run release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9f99c9b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Release + +on: + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup node + uses: actions/setup-node@v4 + with: + always-auth: true + node-version: 20 + cache: "yarn" + scope: "@lingui" + + - name: Install & Build + run: | + yarn install --frozen-lockfile + yarn build + + - name: Creates local .npmrc + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + + - name: Prepare Lingui-Bot git account + uses: oleksiyrudenko/gha-git-credentials@v2-latest + with: + name: "Lingui Bot" + email: "linguibot@gmail.com" + actor: "lingui-bot" + token: "${{ secrets.GH_TOKEN }}" + + - name: Release + run: npm run release diff --git a/.gitignore b/.gitignore index f06235c..82ee25a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules dist +.idea