dramatically speed up nilshell by not switching out of raw each time #43
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: release-jobs | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
test-and-tag-release: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '^1.19.0' | |
- name: Update PATH variable | |
run: echo "$HOME/go/bin" >> $GITHUB_PATH | |
- name: Run tests | |
run: make test | |
- name: Get version | |
run: echo VERSION=$(cat ./VERSION) >> $GITHUB_ENV | |
- name: Check if tag exists in master | |
run: | | |
if git rev-parse ${{ env.VERSION }} > /dev/null 2>&1 | |
then | |
echo "Version ${{ env.VERSION}} already exists" | |
echo "TAG_EXISTS=1" >> $GITHUB_ENV | |
else | |
echo "Version ${{ env.VERSION}} does not exist" | |
echo "TAG_EXISTS=0" >> $GITHUB_ENV | |
fi | |
- name: Generate release | |
if: ${{ (github.ref == 'refs/heads/master') && (env.TAG_EXISTS == 0) }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.VERSION }} | |
generate_release_notes: false |