# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Update Release V1.0 #on: # push: # branches: [ master ] on: workflow_dispatch jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - name: Generate version id: version uses: paulhatch/semantic-version@v4.0.2 with: # The prefix to use to identify tags tag_prefix: "v" # A string which, if present in a git commit, indicates that a change represents a # major (breaking) change, supports regular expressions wrapped with '/' major_pattern: "(MAJOR)" # Same as above except indicating a minor change, supports regular expressions wrapped with '/' minor_pattern: "(MINOR)" # A string to determine the format of the version output format: "${major}.${minor}.${patch}-prerelease${increment}" # Indicate whether short tags like 'v1' should be supported. If false only full # tags like 'v1.0.0' will be recognized. short_tags: true # If this is set to true, *every* commit will be treated as a new version. bump_each_commit: false fetch-depth: branch - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} cache: 'npm' - run: npm ci - run: npm run build --if-present - run: zip build.zip $(find build) - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ steps.version.version_tag }} release_name: ${{ steps.version.version }} draft: false prerelease: true owner: ${{ github.actor }} - 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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./build.zip asset_name: build.zip asset_content_type: application/zip