Skip to content

Commit

Permalink
Added Action
Browse files Browse the repository at this point in the history
  • Loading branch information
harshau007 committed May 29, 2024
1 parent b09b71e commit 897ff36
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest

permissions:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set current date as environment variable
run: echo "DATE=`date +'%Y.%m.%d'`" >>$GITHUB_ENV

- name: Building TCET Linux Welcome Tar file
run: |
cp LinuxBuild/* build/bin/
cd ..
touch alg-welcome.tar.gz
tar -czf alg-welcome.tar.gz alg-welcome/build/bin/
touch checksum
sha256sum alg-welcome.tar.gz > checksum
mv checksum alg-welcome/
mv alg-welcome.tar.gz alg-welcome/
- name: Checking if release with date tag exist
run: |
tag=${{ env.DATE }}
if gh release view $tag; then
echo "RELEASE_EXISTS=true" >> $GITHUB_ENV
else
echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
fi
- name: Checking if release with latest tag exist
run: |
tag=latest
if gh release view $tag; then
echo "LATEST_RELEASE_EXISTS=true" >> $GITHUB_ENV
else
echo "LATEST_RELEASE_EXISTS=false" >> $GITHUB_ENV
fi
- name: Deleting Dated release
if: env.RELEASE_EXISTS == 'true'
run: |
gh release delete ${{ env.DATE }}
- name: Delete Previous Latest release
if: env.LATEST_RELEASE_EXISTS == 'true'
run: |
gh release delete latest
- name: Release Tar File
run: |
gh release create ${{ env.DATE }} *tar.gz checksum --title "ALG Welcome"
- name: Release Tar File with latest
run: |
gh release create latest *tar.gz checksum --latest --title "ALG Welcome"
File renamed without changes
File renamed without changes.

0 comments on commit 897ff36

Please sign in to comment.