From b1f0697bd5dd34d87cd81332ecba5598b36bad82 Mon Sep 17 00:00:00 2001 From: Mirhossein Mousavi Date: Tue, 19 Mar 2024 09:20:33 +0000 Subject: [PATCH] Add release workflow --- .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000000..6af34736d335f9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +# This workflow is triggered on pushes to the master branch and creates a release +# with the "latest" tag. it also removes any previous associated releases. +--- +name: "release" + +on: + push: + branches: + - "master" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + # Shallow clones should be disabled to generate the release tag + fetch-depth: 0 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: latest + - name: Build + run: | + npm install + gulp generic + - name: Commit Build + run: | + git config --global user.email "mrt@surfly.com" + git config --global user.name "mrt" + git add -f build + git commit -m "Update build" + git push + - name: Create Release + run: tar czf build.tar.gz -C build . + - name: Create version tag + run: | + TAG="$(git rev-list --count HEAD)-$(git rev-parse --short HEAD)" + echo "TAG=$TAG" >> $GITHUB_ENV + - name: Create Release + uses: ncipollo/release-action@v1 + with: + artifacts: "build.tar.gz" + tag: ${{ env.TAG }}