Skip to content

Commit

Permalink
Merge pull request #2 from leeford/leeford-patch-1
Browse files Browse the repository at this point in the history
Create release.yml
  • Loading branch information
leeford committed Sep 10, 2021
2 parents 43ce408 + 23eb1e2 commit 5e274c1
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release

on:
push:
branches:
- "!*"
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.5
with:
node-version: 14
registry-url: "https://registry.npmjs.org"

- name: Clean install dependencies and build
run: |
npm ci
npm run build
- name: Zip up Web App
run: |
zip -r ./deployment/webApp.zip * -x './src/*' './deployment/*'
- name: Zip up build artifact
run: |
cd ./deployment
zip -r ../build.zip *
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: build
path: build.zip

release:
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: "0"

- uses: actions/download-artifact@v2
with:
name: build

- name: Generate tag environment variable
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Generate release filename
run: mv build.zip teams-webchat-sample-${{ env.TAG }}.zip

- name: Release
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
allowUpdates: true
replacesArtifacts: true
artifacts: "teams-webchat-sample-v*.zip"
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 5e274c1

Please sign in to comment.