From babc80b4ebdba8a4acd554cdb880035211a2aefb Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Fri, 26 Jul 2024 09:50:34 +0200 Subject: [PATCH 1/2] chore(tools): remove tools.yml --- .github/workflows/tools.yml | 72 ------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 .github/workflows/tools.yml diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml deleted file mode 100644 index f282d7744..000000000 --- a/.github/workflows/tools.yml +++ /dev/null @@ -1,72 +0,0 @@ - -name: Tools and deps update -on: - schedule: - # Run once a week at 00:05 AM UTC on Sunday. - - cron: 5 0 * * 0 - - workflow_dispatch: - inputs: - id: - description: The ID of the job to run - required: true - default: all - type: choice - options: - - all - - swc - -env: - PYTHON_VERSION: '3.12' - -permissions: - contents: read - -jobs: - tools-deps-update: - if: github.repository == 'nodejs/amaro' - runs-on: ubuntu-latest - strategy: - fail-fast: false # Prevent other jobs from aborting if one fails - matrix: - include: - - id: swc - subsystem: deps - label: dependencies - run: | - ./tools/update-swc.sh > temp-output - cat temp-output - tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true - rm temp-output - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id - with: - persist-credentials: false - - name: Set up Python ${{ env.PYTHON_VERSION }} - if: matrix.id == 'icu' && (github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id) - uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 - with: - python-version: ${{ env.PYTHON_VERSION }} - - run: ${{ matrix.run }} - if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id - env: - GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} - - name: Generate commit message if not set - if: env.COMMIT_MSG == '' && (github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id) - run: | - echo "COMMIT_MSG=${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}" >> "$GITHUB_ENV" - - uses: gr2m/create-or-update-pull-request-action@86ec1766034c8173518f61d2075cc2a173fb8c97 # v1.9.4 - if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id - # Creates a PR or update the Action's existing PR, or - # no-op if the base branch is already up-to-date. - env: - GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} - with: - author: Node.js GitHub Bot - body: This is an automated update of ${{ matrix.id }} to ${{ env.NEW_VERSION }}. - branch: actions/tools-update-${{ matrix.id }} # Custom branch *just* for this Action. - commit-message: ${{ env.COMMIT_MSG }} - labels: ${{ matrix.label }} - title: '${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}' - update-pull-request-title-and-body: true From 5422f557b8abfdfd710f83da8e396ec16d37b988 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Fri, 26 Jul 2024 09:52:03 +0200 Subject: [PATCH 2/2] chore(tools): add release pipeline --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..985553c18 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: release +on: + workflow_dispatch: + +permissions: + contents: read + +jobs: + release: + runs-on: ubuntu-latest + + permissions: + contents: write + id-token: write + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm run build + - name: Create NPM release + run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}