diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 713f962..4cbdf28 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -87,35 +95,26 @@ 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 @@ -123,7 +122,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-osx asset_name: vim9-fuzzy-osx-x86-64 asset_content_type: application/zip @@ -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