Skip to content

Merge pull request #50 from Carpenteri1/remove-component-from-store-data #116

Merge pull request #50 from Carpenteri1/remove-component-from-store-data

Merge pull request #50 from Carpenteri1/remove-component-from-store-data #116

Workflow file for this run

name: Create new release for project
on:
push:
tags:
- 'v*' # Matches tags like v1.0, v2.0, etc.
jobs:
build_and_release:
runs-on: ubuntu-latest
permissions:
contents: write # This grants write access to the repository contents
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set tag version
run: |
echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "Tagname set to $TAG_NAME"
- name: Restore dependencies
run: dotnet restore
- name: Build the application
run: dotnet build --configuration Release
- name: Publish build
run: |
dotnet publish -r win-x64 -c Release --self-contained -p:PublishSingleFile=true
dotnet publish -r linux-x64 -c Release --self-contained -p:PublishSingleFile=true
- name: Copy wwwroot and remove unnecessary files
run: |
cp -r bin/Release/net8.0/win-x64/publish/wwwroot /home/runner/work/Gridly/Gridly/bin/Release/net8.0/win-x64/
cp -r bin/Release/net8.0/linux-x64/publish/wwwroot /home/runner/work/Gridly/Gridly/bin/Release/net8.0/linux-x64/
rm -fr /home/runner/work/Gridly/Gridly/bin/Release/net8.0/win-x64/publish
rm -fr /home/runner/work/Gridly/Gridly/bin/Release/net8.0/linux-x64/publish
- name: Install zip tool
run: |
sudo apt-get install -y zip
- name: Package Windows build into ZIP
run: |
echo "TAG_VERSION=${{ env.TAG_VERSION }}"
ZIP_WINDOWS_NAME="Gridly-Windows-$TAG_VERSION.zip"
cd bin/Release/net8.0/
zip -r /home/runner/work/Gridly/Gridly/$ZIP_WINDOWS_NAME win-x64
echo "ZIP_WINDOWS_NAME=$ZIP_WINDOWS_NAME" >> $GITHUB_ENV
- name: Package Linux build into ZIP
run: |
echo "TAG_VERSION=${{ env.TAG_VERSION }}"
ZIP_Linux_NAME="Gridly-Linux-$TAG_VERSION.zip"
cd bin/Release/net8.0/
zip -r /home/runner/work/Gridly/Gridly/$ZIP_Linux_NAME linux-x64
echo "ZIP_Linux_NAME=$ZIP_Linux_NAME" >> $GITHUB_ENV
#- name: Create Git tag with package version
# run: |
# git tag $TAG_VERSION
# git push origin $TAG_VERSION
# echo "new tag $TAG_VERSION created and pushed"
- name: Upload tarball to GitHub Releases
uses: softprops/action-gh-release@v1
with:
files: |
/home/runner/work/Gridly/Gridly/${{ env.ZIP_WINDOWS_NAME }}
/home/runner/work/Gridly/Gridly/${{ env.ZIP_Linux_NAME }}
# Upload the tarball as a release asset
tag_name: ${{ env.TAG_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}