mirror of
https://github.com/input-output-hk/foliage.git
synced 2024-08-17 16:00:38 +03:00
Update release.yml
This commit is contained in:
parent
7474ed7e4c
commit
eb060cd480
45
.github/workflows/release.yml
vendored
45
.github/workflows/release.yml
vendored
@ -1,9 +1,9 @@
|
|||||||
name: Build and Release
|
name: Build and Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
tags:
|
||||||
- main
|
- '*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -14,16 +14,16 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Nix
|
- name: Setup Nix
|
||||||
uses: cachix/install-nix-action@v20
|
uses: cachix/install-nix-action@v20
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: nix build .#packages.${{ matrix.platform }}.default
|
run: nix build .#packages.${{ matrix.platform }}.default --accept-flake-config
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: foliage-${{ matrix.platform }}
|
name: foliage-${{ matrix.platform }}
|
||||||
path: ./result
|
path: ./result
|
||||||
@ -32,9 +32,12 @@ jobs:
|
|||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Download Artifacts
|
- name: Download Artifacts
|
||||||
run: |
|
run: |
|
||||||
@ -44,29 +47,7 @@ jobs:
|
|||||||
unzip artifacts/$platform/foliage.zip -d artifacts/$platform
|
unzip artifacts/$platform/foliage.zip -d artifacts/$platform
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release and Upload Release Assets
|
||||||
id: create_release
|
uses: ncipollo/release-action@v1
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
artifacts: "artifacts/*"
|
||||||
release_name: Release ${{ github.ref }}
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
|
|
||||||
- name: Upload Release Assets
|
|
||||||
run: |
|
|
||||||
for platform in aarch64-linux aarch64-darwin x86_64-linux x86_64-darwin; do
|
|
||||||
asset_path=artifacts/$platform/foliage
|
|
||||||
asset_name=foliage-$platform
|
|
||||||
asset_content_type=application/octet-stream
|
|
||||||
upload_url=${{ steps.create_release.outputs.upload_url }}
|
|
||||||
echo "Uploading $asset_name to $upload_url ..."
|
|
||||||
curl \
|
|
||||||
--header 'Content-Type: $asset_content_type' \
|
|
||||||
--header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
|
|
||||||
--data-binary @$asset_path \
|
|
||||||
--upload-file $asset_path \
|
|
||||||
$upload_url?name=$asset_name
|
|
||||||
done
|
|
||||||
|
Loading…
Reference in New Issue
Block a user