Skip to content

Bump tj-actions/branch-names from 7.0.7 to 9.0.0 in /.github/workflows #66

Bump tj-actions/branch-names from 7.0.7 to 9.0.0 in /.github/workflows

Bump tj-actions/branch-names from 7.0.7 to 9.0.0 in /.github/workflows #66

name: Create pre-release
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: Get branch names.
id: branch-names
uses: tj-actions/branch-names@v9.0.0
# check code out
- uses: actions/checkout@v2
- name: Set commit short for pull requests
if: ${{ github.event_name == 'pull_request' }}
run: |
COMMIT=`expr substr ${{ github.event.pull_request.head.sha }} 1 7`
echo "COMMIT=$COMMIT" >> $GITHUB_ENV
- name: Set commit short for pushes
if: ${{ github.event_name == 'push' }}
run: |
COMMIT=`expr substr $GITHUB_SHA 1 7`
echo "COMMIT=$COMMIT" >> $GITHUB_ENV
- name: Figure out version name
run: |
VERSION=$(printf "%s-pre-%s-%s" `cat .version` "$COMMIT" "${{ steps.branch-names.outputs.current_branch }}")
echo "VERSION=$VERSION" >> $GITHUB_ENV
# Runs a set of commands using the runners shell
- name: Create release artiface
run: |
echo "return '$VERSION'" > version.lua
zip Bashing.mpackage config.lua script.lua Bashing.xml version.lua License.md
- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: Bashing.mpackage
tag: ${{ env.VERSION }}
commit: ${{ steps.branch-names.outputs.current_branch }}
body: Release of version ${{ env.VERSION }}
name: ${{ env.VERSION }}
prerelease: true