Skip to content

Update dependency @types/node to v20.16.6 #34

Update dependency @types/node to v20.16.6

Update dependency @types/node to v20.16.6 #34

Workflow file for this run

name: Build and release the action
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: "Install"
run: |
npm install
- name: "Prettier"
run: |
npm run format-check
- name: "Lint"
run: |
npm run lint
- name: "Test"
run: |
npm run test
- name: "build"
run: |
npm run build
npm run package
test:
runs-on: ubuntu-22.04
env:
EMAIL_INPUT: [email protected]
USERNAME_INPUT: example-test
steps:
- uses: actions/checkout@v4
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: "Build action for test"
run: |
npm install
npm run build
npm run package
git clean -fXd
- uses: webiny/[email protected]
with:
run: .github/scripts/test_post.sh
- name: Test executing the action
uses: ./
env:
GIT_DEPLOY_KEY: not-a-real-key
AUTH_TOKEN_STRING: |
email = [email protected]
with:
email: ${{ env.EMAIL_INPUT }}
username: ${{ env.USERNAME_INPUT }}
- run: |
set -u
cat "$RUNNER_TEMP/setup-npm-publish-action/id_rsa"
echo
git config user.name
git config user.email
git remote get-url origin
git config core.sshCommand
grep '^github\.com' "$RUNNER_TEMP/setup-npm-publish-action/known_hosts"
[[ "$(cat "$RUNNER_TEMP/setup-npm-publish-action/id_rsa")" == "not-a-real-key" ]]
[[ "$(git config user.name)" == "${{ env.USERNAME_INPUT }}" ]]
[[ "$(git config user.email)" == "${{ env.EMAIL_INPUT }}" ]]
[[ "$(git remote get-url origin)" == "[email protected]:$GITHUB_REPOSITORY.git" ]]
# Just check that it is altered from default
[[ "$(git config core.sshCommand)" == *UserKnownHostsFile* ]]
test-cleanup-non-repo:
runs-on: ubuntu-22.04
env:
EMAIL_INPUT: [email protected]
USERNAME_INPUT: example-test
steps:
- uses: actions/checkout@v4
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: "Build action for test"
run: |
npm install
npm run build
npm run package
git clean -fXd
- uses: webiny/[email protected]
with:
run: .github/scripts/test_missing_npmrc_post.sh
- name: Test executing the action
uses: ./
env:
GIT_DEPLOY_KEY: not-a-real-key
AUTH_TOKEN_STRING: |
email = [email protected]
with:
email: ${{ env.EMAIL_INPUT }}
username: ${{ env.USERNAME_INPUT }}
- run: |
set -u
cat "$RUNNER_TEMP/setup-npm-publish-action/id_rsa"
echo
git config user.name
git config user.email
git remote get-url origin
git config core.sshCommand
grep '^github\.com' "$RUNNER_TEMP/setup-npm-publish-action/known_hosts"
[[ "$(cat "$RUNNER_TEMP/setup-npm-publish-action/id_rsa")" == "not-a-real-key" ]]
[[ "$(git config user.name)" == "${{ env.USERNAME_INPUT }}" ]]
[[ "$(git config user.email)" == "${{ env.EMAIL_INPUT }}" ]]
[[ "$(git remote get-url origin)" == "[email protected]:$GITHUB_REPOSITORY.git" ]]
# Just check that it is altered from default
[[ "$(git config core.sshCommand)" == *UserKnownHostsFile* ]]
- run: rm -rf .git
test-missing-npmrc:
runs-on: ubuntu-22.04
env:
EMAIL_INPUT: [email protected]
USERNAME_INPUT: example-test
steps:
- uses: actions/checkout@v4
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: "Build action for test"
run: |
npm install
npm run build
npm run package
git clean -fXd
- run: |
git config --global user.email "[email protected]"
git config --global user.name "Testing"
git rm .npmrc
git commit -m "mark removed npmrc file"
- uses: webiny/[email protected]
with:
run: .github/scripts/test_missing_npmrc_post.sh
- name: Test executing the action
uses: ./
env:
GIT_DEPLOY_KEY: not-a-real-key
AUTH_TOKEN_STRING: |
email = [email protected]
with:
email: ${{ env.EMAIL_INPUT }}
username: ${{ env.USERNAME_INPUT }}
- run: |
set -u
cat "$RUNNER_TEMP/setup-npm-publish-action/id_rsa"
echo
git config user.name
git config user.email
git remote get-url origin
git config core.sshCommand
grep '^github\.com' "$RUNNER_TEMP/setup-npm-publish-action/known_hosts"
[[ "$(cat "$RUNNER_TEMP/setup-npm-publish-action/id_rsa")" == "not-a-real-key" ]]
[[ "$(git config user.name)" == "${{ env.USERNAME_INPUT }}" ]]
[[ "$(git config user.email)" == "${{ env.EMAIL_INPUT }}" ]]
[[ "$(git remote get-url origin)" == "[email protected]:$GITHUB_REPOSITORY.git" ]]
# Just check that it is altered from default
[[ "$(git config core.sshCommand)" == *UserKnownHostsFile* ]]
test-all:
needs:
- test
- test-cleanup-non-repo
- test-missing-npmrc
runs-on: ubuntu-22.04
steps:
- run: |
echo "Ok"
shell: bash
release:
runs-on: ubuntu-22.04
name: "Build and release action"
needs: [build, test-all]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
- name: Configure git
uses: smartlyio/github-actions@git-init-userinfo-v1
- name: Release flow
uses: smartlyio/github-actions@release-action-node-v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"