@@ -18,24 +18,53 @@ jobs:
1818 steps :
1919 - name : Checkout sources
2020 uses : actions/checkout@v3
21+ with :
22+ ssh-key : ${{ secrets.DEPLOY_KEY }}
2123
2224 - name : Install node 18
2325 uses : actions/setup-node@v3
2426 with :
25- node-version : ' 18 '
27+ node-version : 18
2628 cache : npm
29+ registry-url : ' https://npm.pkg.github.com'
2730
28- - name : Setup Java 17
29- uses : actions/setup-java@v3
30- with :
31- distribution : temurin
32- java-version : 17
31+ - name : Configure git
32+ run : |
33+ git config user.name "${{ github.actor }}"
34+ git config user.email "${{ github.actor }}@users.noreply.github.com"
35+
36+ - name : Update package with new version
37+ id : bump
38+ run : |
39+ echo "version=$(npm version prerelease --no-git-tag-version --preid ea)" >> "$GITHUB_OUTPUT"
3340
3441 - name : Install project modules
35- run : npm ci
42+ run : npm ci --production
3643
37- - name : Lint source files
38- run : npm run lint
44+ - name : Publish package
45+ run : npm publish
3946
40- - name : Run unit tests and verify code coverage
41- run : npm test
47+ - name : Commit and push package modifications
48+ run : |
49+ git add package.json
50+ git add package-lock.json
51+ git commit -m "build: updated package with ${{ steps.bump.outputs.version }} [skip ci]"
52+ git push
53+
54+ - name : Create and push new tag
55+ run : |
56+ git tag ${{ steps.bump.outputs.version }} -m "${{ steps.bump.outputs.version }}"
57+ git push origin ${{ steps.bump.outputs.version }}
58+
59+ - name : Create a release
60+ uses : actions/github-script@v6.4.1
61+ with :
62+ github-token : ${{ secrets.STAGING_PAT }}
63+ script : |
64+ const repo_name = context.payload.repository.full_name
65+ const response = await github.request('POST /repos/' + repo_name + '/releases', {
66+ tag_name: '${{ steps.bump.outputs.version }}',
67+ name: '${{ steps.bump.outputs.version }}',
68+ prerelease: true,
69+ generate_release_notes: true
70+ })
0 commit comments