Skip to content

Commit

Permalink
Merge pull request #7 from tcet-opensource/new-release
Browse files Browse the repository at this point in the history
Update release.yml
  • Loading branch information
Akash6222 authored Dec 22, 2023
2 parents 1a15869 + f0e4b4f commit c892f63
Showing 1 changed file with 40 additions and 26 deletions.
66 changes: 40 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:

jobs:
Expand All @@ -9,47 +12,58 @@ jobs:

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

steps:
- name: Checkout
uses: actions/checkout@v4
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
- name: Building TCET Linux set-once Tar file
run: |
ls -la
cd ..
ls -la
touch tcet-linux-set-once.tar.gz
tar -czf tcet-linux-set-once.tar.gz tcet-linux-set-once/
touch checksum
sha256sum tcet-linux-set-once.tar.gz > checksum
mv checksum tcet-linux-set-once/
mv tcet-linux-set-once.tar.gz tcet-linux-set-once/
ls -la
- name: Delete Previous Latest release
uses: dev-drprasad/[email protected]
with:
tag_name: latest
github_token: ${{ secrets.PAT_TOKEN }}
delete_release: true
- 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: Release Tar File with latest
uses: ncipollo/release-action@v1
with:
artifacts: "*.tar.gz,checksum"
generateReleaseNotes: false
name: "TCET-Linux-set-once"
tag: latest
- 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
uses: ncipollo/release-action@v1
with:
artifacts: "*.tar.gz,checksum"
generateReleaseNotes: false
name: "TCET-Linux-set-once"
tag: ${{ env.DATE }}


run: |
gh release create ${{ env.DATE }} *tar.gz checksum --title "TCET-Linux set-once"
- name: Release Tar File with latest
run: |
gh release create latest *tar.gz checksum --latest --title "TCET-Linux set-once"

0 comments on commit c892f63

Please sign in to comment.