Skip to content

Commit

Permalink
Update release.yml to trigger on tag pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
0GiS0 committed Dec 13, 2023
1 parent 231a313 commit 14373c4
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/release-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Generate Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build and zip
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- run: npm ci --force
- run: npm run build --if-present
- name: Copy web.config inside dist
run: mv web.config dist/angular-tour-of-heroes/web.config
- name: Zip dist
run: cd dist/angular-tour-of-heroes ; zip -r ../../dist.zip . * ; cd ../../
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Release generated automatically by GitHub Actions
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist.zip
asset_name: dist.zip
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Generate Angular release

on:
on:
push:
tags:
- v*
Expand Down

0 comments on commit 14373c4

Please sign in to comment.