Skip to content

chore: bump version from 1.0.8 to 1.0.9 in relevant files #70

chore: bump version from 1.0.8 to 1.0.9 in relevant files

chore: bump version from 1.0.8 to 1.0.9 in relevant files #70

name: Build and Release
on: push
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
# - windows-latest
include:
- os: ubuntu-latest
image: ubuntu:latest
- os: macos-latest
image: macos-latest
#- os: windows-latest
#image: windows-latest
steps:
- name: Set dummy ACTIONS_RUNTIME_TOKEN and ACTIONS_RUNTIME_URL for act
if: ${{ env.ACT }}
run: |
echo "ACTIONS_RUNTIME_TOKEN=dummy_token" >> $GITHUB_ENV
echo "ACTIONS_RUNTIME_URL=https://dummy_url" >> $GITHUB_ENV
# - name: Install GCC on Ubuntu
# if: matrix.os == 'ubuntu-latest' && ${{env.ACT}}
# run: |
# apt-get update
# apt-get install -y gcc
# - name: Install GCC on macOS
# if: matrix.os == 'macos-latest' && ${{ env.ACT }}
# run: |
# brew install gcc
- name: Checkout code
uses: actions/checkout@v2
- name: Build on Linux and macOS
run: |
mkdir ${{ matrix.os }}
gcc await.c -o ${{ matrix.os }}/await -lpthread
- name: Generate autocompletion scripts
run: |
./${{ matrix.os }}/await --autocomplete-fish > ${{ matrix.os }}/await.fish
./${{ matrix.os }}/await --autocomplete-bash > ${{ matrix.os }}/await.bash
./${{ matrix.os }}/await --autocomplete-zsh > ${{ matrix.os }}/await.zsh
- name: Tree
if: matrix.os == 'ubuntu-latest'
run: tree
- uses: actions/upload-artifact@v4
with:
name: await-${{ matrix.os }}
path: ${{ matrix.os }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Check if Release Exists
id: check_release
run: |
gh release view 1.0.8 || echo "Release does not exist"
- name: Create or Update Release
id: create_update_release
if: steps.check_release.outputs.exists == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 1.0.8
release_name: 1.0.8
body: Fixed ctrl-c handling when it's run from bash script
draft: false
prerelease: false
- name: Update Release Archives
if: steps.check_release.outputs.exists == 'true'
run: |
gh release upload 1.0.8 archives/* --clobber
- name: Download Artifact
uses: actions/download-artifact@v4
- name: Create Archives
run: |
mkdir -p archives
tree
tar -czvf archives/await-1.0.8-aarch64-x86_64-apple-darwin.tar.gz -C await-macos-latest .
tar -czvf archives/await-1.0.8-x86_64-unknown-linux-gnu.tar.gz -C await-ubuntu-latest .
tree
- name: Upload Release Artifacts
uses: softprops/action-gh-release@v1
with:
files: archives/*
tag_name: 1.0.8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}