Add release steps thingy #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: | |
jobs: | |
verify: | |
name: Verify files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 'lts/*' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run linter | |
run: npm run lint | |
- name: Test Tailwind | |
working-directory: test | |
run: | | |
npm install | |
npm run lint | |
npm run build | |
- name: Package application | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
# Load version from Git | |
npm version --allow-same-version --no-git-tag-version from-git | |
# Set as env | |
export NODE_PKG_VERSION=$( jq -r '.version' package.json ) | |
echo "NODE_PKG_VERSION=${NODE_PKG_VERSION}" >> $GITHUB_ENV | |
# Build and package | |
npm run package | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
name: Version ${{ env.NODE_PKG_VERSION }} | |
files: gumbo-millennium-eslint-config-${{ env.NODE_PKG_VERSION }}.tgz | |
generate_release_notes: true | |
body: | | |
This package contains the configuration for the Gumbo Millennium ESLint rules version ${{ env.NODE_PKG_VERSION }}. | |
To install this in your project, add the following to your `package.json` | |
```bash | |
"devDependencies": { | |
"@${{ github.repository_owner }}/${{ github.repository }}": "${{ github.server_url }}/${{ github.repository_owner }}/${{ github.repository }}/releases/download/v${{ env.NODE_PKG_VERSION }}/gumbo-millennium-eslint-config-${{ env.NODE_PKG_VERSION }}.tgz" | |
} | |
``` | |
--- |