Skip to content

Commit

Permalink
macos ci fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kohnish committed Aug 15, 2023
1 parent a460584 commit 9dec085
Showing 1 changed file with 31 additions and 32 deletions.
63 changes: 31 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,28 @@ env:
BUILD_TYPE: Release

jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
# Note this. We are going to use that in further jobs.
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

build:
runs-on: ubuntu-latest
container: alpine:edge
needs: create_release

steps:
- uses: actions/checkout@v3
Expand All @@ -37,24 +56,13 @@ jobs:
- name: install-win
run: cd build-win && make install/strip && sha256sum ../bin/vim9-fuzzy.exe | awk '{print $1}' > sha256.txt

- name: release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

- name: upload
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 }}
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: bin/vim9-fuzzy
asset_name: vim9-fuzzy-linux-x86-64
asset_content_type: application/zip
Expand All @@ -65,7 +73,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build/sha256.txt
asset_name: sha256-linux-x86-64.txt
asset_content_type: application/zip
Expand All @@ -76,7 +84,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: bin/vim9-fuzzy.exe
asset_name: vim9-fuzzy-win-x86-64
asset_content_type: application/zip
Expand All @@ -87,43 +95,34 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build-win/sha256.txt
asset_name: sha256-win-x86-64.txt
asset_content_type: application/zip

macos-build:
macos:
runs-on: macos-latest
needs: create_release

steps:
- uses: actions/checkout@v3

- name: cmake
run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_FULL=ON ..
run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_STATIC=ON ..

- name: build
run: cd build && make -j

- name: install
run: cd build && make install/strip && mv ../bin/vim9-fuzzy ../bin/vim9-fuzzy-osx && sha256sum ../bin/vim9-fuzzy-osx | awk '{print $1}' > sha256.txt

- name: release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
run: cd build && make install/strip && mv ../bin/vim9-fuzzy ../bin/vim9-fuzzy-osx && shasum -a 256 ../bin/vim9-fuzzy-osx | awk '{print $1}' > sha256-osx.txt

- name: upload
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 }}
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: bin/vim9-fuzzy-osx
asset_name: vim9-fuzzy-osx-x86-64
asset_content_type: application/zip
Expand All @@ -134,7 +133,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/sha256.txt
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build/sha256-osx.txt
asset_name: sha256-osx-x86-64.txt
asset_content_type: application/zip

0 comments on commit 9dec085

Please sign in to comment.