Skip to content

Commit

Permalink
Fix: actions
Browse files Browse the repository at this point in the history
  • Loading branch information
WenSimEHRP committed May 13, 2024
1 parent e861c5c commit 1dd364c
Showing 1 changed file with 7 additions and 39 deletions.
46 changes: 7 additions & 39 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,30 @@ name: Release

on:
workflow_dispatch:
push:
tags:
- "*"

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
continue-on-error: true

- name: Install Dependencies
run: |
bash install_dependencies.sh
pip3 install -r requirements.txt
continue-on-error: false
- name: Build
id: build
run: make all
continue-on-error: true

- name: Set Tag Name
id: set_tag
run: echo "tag_name=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
shell: bash

- name: Check Build Status
id: check_status
run: |
if [ "${{ steps.build.outcome }}" != "success" ]
then
echo "One or more steps failed. Skipping release creation."
echo "::set-output name=skip_release::true"
fi
continue-on-error: true

- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ env.tag_name }}
release_name: Release ${{ env.tag_name }}
body: |
Release ${{ env.tag_name }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ steps.check_status.outputs.skip_release != 'true' }}

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
uses: ncipollo/release-action@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./cns.grf
asset_name: cns.grf
asset_content_type: binary/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
artifacts: "cns.grf"

0 comments on commit 1dd364c

Please sign in to comment.