Merge pull request #20 from TheGiddyLimit/bugfix/simplify-form-acquis… #21
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: Module CI/CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Get the version from 'module.json' | |
- name: Get Version | |
shell: bash | |
id: get-version | |
run: echo "::set-output name=version::$(node ./.github/workflows/get-version.js)" | |
#Substitute the Manifest and Download URLs in the module.json | |
- name: Substitute Manifest and Download Links For Versioned Ones | |
id: sub_manifest_link_version | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: './src/module.json' | |
env: | |
url: https://github.com/${{github.repository}} | |
manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json | |
download: https://github.com/${{github.repository}}/releases/download/${{steps.get-version.outputs.version}}/module.zip | |
- name: Use Node.js 14.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14.x | |
- name: Build | |
run: | | |
npm install | |
gulp build | |
# create a zip file with all files required by the module to add to the release | |
- name: Zip Files | |
working-directory: ./dist | |
run: zip -r ../module.zip * | |
# Update the 'latest' release | |
- name: Update Latest Release | |
id: create_latest_release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
name: Latest | |
draft: false | |
prerelease: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: './dist/module.json, ./module.zip' | |
tag: latest | |
commit: main | |
# Create a release for this specific version | |
- name: Create Version Release | |
id: create_version_release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: false | |
name: Release ${{ steps.get-version.outputs.version }} | |
draft: false | |
prerelease: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: './dist/module.json, ./module.zip' | |
tag: ${{ steps.get-version.outputs.version }} |