From 286353f36e436f84825c0cd9ea8895a807165590 Mon Sep 17 00:00:00 2001 From: Alex Lanz Date: Fri, 28 Jul 2023 10:46:52 +0200 Subject: [PATCH 1/2] optimize CI --- .github/workflows/main.yml | 30 ++++++++++++++++++------------ .github/workflows/test.yml | 19 +++++++++++++++++++ .gitignore | 3 +-- 3 files changed, 38 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 033d2ca15..ad8758bd9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,26 +1,32 @@ name: Create Relase & Publish Package + on: push: tags: - 'v*' + +env: + NODE_VERSION: 16 + jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 + timeout-minutes: 5 steps: - - uses: actions/checkout@v2 - - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v3 + - uses: actions/github-script@v6 with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - - uses: actions/setup-node@v1 + script: | + github.rest.repos.createRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: '${{ github.ref }}', + name: 'Release ${{ github.ref_name }}' + }) + - uses: aboutbits/github-actions-node/setup-and-install@v1 with: - node-version: '16.x' + node-version: ${{ env.NODE_VERSION }} registry-url: 'https://registry.npmjs.org' - - run: npm install - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..80a8fc87b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,19 @@ +name: Test Package + +on: push + +env: + NODE_VERSION: 16 + +jobs: + test: + runs-on: ubuntu-22.04 + timeout-minutes: 15 + steps: + - uses: actions/checkout@v3 + - uses: aboutbits/github-actions-node/setup-and-install@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - run: npm run lint + - run: npm run typecheck + - run: npm run test diff --git a/.gitignore b/.gitignore index 0c0c2c9ad..6a6a9375c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,8 @@ /.vscode # Project -/package-lock.json /node_modules /dist # ESLint -.eslintcache \ No newline at end of file +.eslintcache From fe1e5fa46fb31228c9052925f1b03c64995531ff Mon Sep 17 00:00:00 2001 From: Alex Lanz Date: Fri, 28 Jul 2023 10:50:25 +0200 Subject: [PATCH 2/2] rename GitHub action files --- .github/workflows/main.yml | 27 +++++++-------------------- .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 19 ------------------- 3 files changed, 39 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ad8758bd9..80a8fc87b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,32 +1,19 @@ -name: Create Relase & Publish Package +name: Test Package -on: - push: - tags: - - 'v*' +on: push env: NODE_VERSION: 16 jobs: - build: + test: runs-on: ubuntu-22.04 - timeout-minutes: 5 + timeout-minutes: 15 steps: - uses: actions/checkout@v3 - - uses: actions/github-script@v6 - with: - script: | - github.rest.repos.createRelease({ - owner: context.repo.owner, - repo: context.repo.repo, - tag_name: '${{ github.ref }}', - name: 'Release ${{ github.ref_name }}' - }) - uses: aboutbits/github-actions-node/setup-and-install@v1 with: node-version: ${{ env.NODE_VERSION }} - registry-url: 'https://registry.npmjs.org' - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - run: npm run lint + - run: npm run typecheck + - run: npm run test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..ad8758bd9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Create Relase & Publish Package + +on: + push: + tags: + - 'v*' + +env: + NODE_VERSION: 16 + +jobs: + build: + runs-on: ubuntu-22.04 + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/github-script@v6 + with: + script: | + github.rest.repos.createRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: '${{ github.ref }}', + name: 'Release ${{ github.ref_name }}' + }) + - uses: aboutbits/github-actions-node/setup-and-install@v1 + with: + node-version: ${{ env.NODE_VERSION }} + registry-url: 'https://registry.npmjs.org' + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 80a8fc87b..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Test Package - -on: push - -env: - NODE_VERSION: 16 - -jobs: - test: - runs-on: ubuntu-22.04 - timeout-minutes: 15 - steps: - - uses: actions/checkout@v3 - - uses: aboutbits/github-actions-node/setup-and-install@v1 - with: - node-version: ${{ env.NODE_VERSION }} - - run: npm run lint - - run: npm run typecheck - - run: npm run test