Merge pull request #25 from zendesk/dependabot/npm_and_yarn/eslint/js… #19
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
name: Main workflow | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "src/*" | |
- "**.js" | |
- "**.ts" | |
- "**.json" | |
jobs: | |
get_version: | |
name: Retrieve version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.package_version.outputs.version }} | |
steps: | |
- uses: zendesk/checkout@v4 | |
- name: Get Package version | |
id: package_version | |
run: | | |
echo "Reading package.json" | |
PACKAGE_VERSION=$(cat ./package.json | jq '.version' | tr -d '"') | |
echo "version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT | |
create-release: | |
name: Create release | |
runs-on: ubuntu-latest | |
needs: | |
- get_version | |
env: | |
VERSION: ${{ needs.get_version.outputs.version }} | |
GH_TOKEN: ${{ github.token }} | |
steps: | |
- name: Create release | |
run: | | |
gh release create ${{ env.VERSION }} -R '${{ github.repository }}' --generate-notes | |
release: | |
name: Release package on Github Packages | |
runs-on: ubuntu-latest | |
needs: | |
- create-release | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: zendesk/checkout@v4 | |
- uses: zendesk/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "npm" | |
cache-dependency-path: "package-lock.json" | |
registry-url: https://npm.pkg.github.com/ | |
- name: Install dependencies | |
run: npm ci | |
- name: Build package | |
run: npm run build | |
- name: Publish to Github Packages | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |