Update to latest FGT version 7.2.5 (default) and 7.4.0 #37
Workflow file for this run
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: >- | |
Automatically create a release if there's a pull request merged from a version branch. | |
on: | |
pull_request: | |
branches: | |
- main | |
types: [closed] | |
workflow_dispatch: | |
inputs: | |
pr-number: | |
description: >- | |
The pull request id that triggers the release (for manual trigger only) | |
required: false | |
jobs: | |
main_job: | |
runs-on: ubuntu-latest | |
name: process pull request merge event | |
# conditionally run only when the pull request is merged. | |
if: github.event.pull_request.merged == true || github.event.inputs.pr-number != '' | |
steps: | |
- name: Use NodeJS version 18 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '18' | |
# check if this pull request coming from a version-branch | |
# if yes then proceed to create a release | |
# if no then skip the following steps | |
- name: Use NodeJS version 18 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- id: fetch-versioning-info | |
name: fetch versioning info | |
uses: fortinet/[email protected] | |
with: | |
pr-number: ${{ github.event.number || github.event.inputs.pr-number}} | |
github-token: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
# create a release | |
- name: 'prep: git checkout' | |
uses: actions/checkout@v2 | |
- name: 'prep: install dependencies' | |
run: npm ci | |
- name: build project | |
run: npm run build | |
- name: make release assets | |
# the make release command may vary | |
run: npm run make-dist | |
- id: create-release | |
name: create release | |
# run only if the merged pull request is from a version branch | |
if: ${{ steps['fetch-versioning-info'].outputs['is-version-branch'] == 'true' }} | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ steps['fetch-versioning-info'].outputs['head-version'] }} # Use the output from the `fetch-versioning-info` step | |
release_name: ${{ steps['fetch-versioning-info'].outputs['head-version'] }} # Use the output from the `fetch-versioning-info` step | |
draft: false | |
prerelease: ${{ steps['fetch-versioning-info'].outputs['is-prerelease'] == 'true' }} # Use the output from the `fetch-versioning-info` step | |
- id: upload-release-asset | |
name: upload release assets | |
# run only if the merged pull request is from a version branch | |
if: ${{ steps['fetch-versioning-info'].outputs['is-version-branch'] == 'true' }} | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps['fetch-versioning-info'].outputs['head-version'] }} # Use the output from the `fetch-versioning-info` step | |
prerelease: ${{ steps['fetch-versioning-info'].outputs['is-prerelease'] == 'true' }} # Use the output from the `fetch-versioning-info` step | |
file: ./fortigate-autoscale-azure*.zip | |
file_glob: true | |
overwrite: true |