Skip to content

Merge branch 'main' of https://github.com/kgarrity22/country-flags #16

Merge branch 'main' of https://github.com/kgarrity22/country-flags

Merge branch 'main' of https://github.com/kgarrity22/country-flags #16

Workflow file for this run

name: Release to GitHub and npm
on:
push:
branches:
- main
# paths:
# - "package.json"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm install
- name: Build package
run: npm run build
- name: Run semantic-release
run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push changes and tags back to repository
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git push --follow-tags
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Create Release on GitHub
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.semantic-release.outputs.version }}
name: Release ${{ steps.semantic-release.outputs.version }}
files: |
dist/*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}