Skip to content

Commit

Permalink
Add package step again
Browse files Browse the repository at this point in the history
We still need this...
  • Loading branch information
arnested committed Jun 9, 2022
1 parent 7718455 commit ecc6f4e
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 12 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist/
node_modules/
27 changes: 21 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,48 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Rebuild dist
id: dist
run: |
npm install
npm run package
git config user.name github-actions
git config user.email [email protected]
git add --force dist/index.js
(git commit -m 'Publish dist' && echo '::set-output name=changed::true') || echo '::set-output name=changed::false'
- name: Push rebuild dist
if: ${{ steps.dist.outputs.changed == 'true' }}
run: |
git push origin main
- name: Bump version and push tag
uses: anothrNick/[email protected]
if: ${{ steps.dist.outputs.changed == 'true' }}
id: version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
- name: Major version tag
id: major-version
if: ${{ (steps.version.outputs.new_tag != '') }}
if: ${{ (steps.dist.outputs.changed == 'true') && (steps.version.outputs.new_tag != '') }}
uses: actions/github-script@v6
with:
script: |
core.setOutput('tag', '${{ steps.version.outputs.new_tag }}'.split('.')[0])
- name: Tag ${{ steps.major-version.outputs.tag }}
if: ${{ (steps.version.outputs.new_tag != '') }}
if: ${{ (steps.dist.outputs.changed == 'true') && (steps.version.outputs.new_tag != '') }}
run: |
git tag --force ${{ steps.major-version.outputs.tag }}
git push origin ${{ steps.major-version.outputs.tag }} --force
- name: Get current date
if: ${{ (steps.dist.outputs.changed == 'true') && (steps.version.outputs.new_tag != '') }}
id: date
run: echo "::set-output name=date::$(date --iso-8601)"
- name: Build full ChangeLog
if: ${{ (steps.version.outputs.new_tag != '') }}
if: ${{ (steps.dist.outputs.changed == 'true') && (steps.version.outputs.new_tag != '') }}
run: npx conventional-changelog-cli --release-count=0 --preset=eslint --outfile="${{ runner.temp }}/FullChangeLog.md"
- name: Create/update major version release
if: ${{ (steps.version.outputs.new_tag != '') }}
if: ${{ (steps.dist.outputs.changed == 'true') && (steps.version.outputs.new_tag != '') }}
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -48,10 +63,10 @@ jobs:
name: ${{ steps.version.outputs.new_tag }} (${{ steps.date.outputs.date }})
bodyFile: ${{ runner.temp }}/FullChangeLog.md
- name: Build ChangeLog
if: ${{ (steps.version.outputs.new_tag != '') }}
if: ${{ (steps.dist.outputs.changed == 'true') && (steps.version.outputs.new_tag != '') }}
run: npx conventional-changelog-cli --release-count=2 --outfile="${{ runner.temp }}/ChangeLog.md"
- name: Create release
if: ${{ (steps.version.outputs.new_tag != '') }}
if: ${{ (steps.dist.outputs.changed == 'true') && (steps.version.outputs.new_tag != '') }}
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- uses: actions/checkout@v3
- run: |
npm install
npm run package
- uses: ./
id: go-version-1
with:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,5 @@ Thumbs.db

# Ignore built ts files
__tests__/runner/*
lib/**/*

dist/
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ outputs:
description: The go module path (as specified by go.mod)
runs:
using: node16
main: src/main.js
main: dist/index.js
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
"name": "go-version-action",
"private": true,
"description": "Go Version action",
"main": "src/index.js",
"main": "src/main.js",
"scripts": {
"format": "prettier --write **/*.js",
"format-check": "prettier --check **/*.js",
"lint": "eslint **/*.js",
"lint-fix": "eslint --fix **/*.js",
"lint": "eslint .",
"lint-fix": "eslint --fix .",
"test": "jest",
"all": "npm run format && npm run lint && npm test"
"package": "ncc build --minify",
"all": "npm run format && npm run lint && npm run package && npm test"
},
"type": "module",
"keywords": [
Expand All @@ -25,6 +26,7 @@
},
"devDependencies": {
"@babel/preset-env": "^7.18.2",
"@vercel/ncc": "^0.34.0",
"babel-jest": "^28.1.1",
"eslint": "^8.17.0",
"eslint-plugin-github": "^4.3.6",
Expand Down

0 comments on commit ecc6f4e

Please sign in to comment.