🎉 initial source: add project #1 #1
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
# This workflow will build and test an Angular project | |
name: Vang (ViteJS & Angular) | |
on: | |
push: | |
branches: ['master'] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: ['master'] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: ['>=16.0.0'] # Specify the Node.js version range | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
create-release: | |
runs-on: ubuntu-latest | |
# Only run this job when a valid tag is pushed | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Check if tag exists | |
id: check_tag | |
run: | | |
if [ -n "$GITHUB_REF" ]; then | |
TAG=${GITHUB_REF#refs/tags/} | |
echo "TAG=${TAG}" >> $GITHUB_ENV | |
else | |
echo "TAG=" >> $GITHUB_ENV | |
fi | |
shell: bash | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Apply changelog | |
run: chmod +x git_changelog.sh | |
- name: Generate changelog | |
id: changelog | |
run: | | |
CHANGELOG=$(./git_changelog.sh) | |
echo "CHANGELOG=$CHANGELOG" >> $GITHUB_ENV | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.TAG }} | |
body: | | |
:gem: released new version ${{ env.TAG }} | |
Changelog: | |
${{ env.CHANGELOG }} | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |