fix: fixed broken tests #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: π¦ Create Release and Zip Folder | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
permissions: | |
actions: write | |
checks: write | |
contents: write | |
deployments: write | |
pull-requests: write | |
repository-projects: write | |
steps: | |
- name: ποΈ Checkout code | |
uses: actions/checkout@v4.1.1 | |
with: | |
submodules: true # Fetch all submodules if any (true OR recursive) | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: πͺͺ Set repository name variable | |
run: echo "REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 2)" >> $GITHUB_ENV | |
- name: π§ Setup Node.js to build extension | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.12.0 | |
- name: π¦ Install dependencies | |
working-directory: . | |
run: | | |
npm install | |
- name: ποΈ Build extension | |
working-directory: . | |
run: | | |
rm -Rf dist | |
npm run build | |
mv dist "${{ env.REPO_NAME }}" | |
- name: π Set date and SHA variables | |
id: vars | |
run: | | |
echo "DATE=$(date +'%Y%m%d-%H%M')" >> $GITHUB_ENV | |
echo "SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
echo "TAG_NAME=v$(date +'%Y%m%d-%H%M')" >> $GITHUB_ENV | |
echo "RELEASE_NAME=${{ env.REPO_NAME }}-$(date +'%Y%m%d-%H%M').zip" >> $GITHUB_ENV | |
- name: ποΈ Zip the extension folder | |
run: zip -r "${{ env.RELEASE_NAME }}" "${{ env.REPO_NAME }}" | |
- name: π·οΈ Create and push tag | |
run: | | |
git tag $TAG_NAME | |
git push origin $TAG_NAME | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: π Create Release & Upload Asset | |
uses: softprops/action-gh-release@v1 | |
#if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: "${{ env.RELEASE_NAME }}" | |
name: "Release v${{ env.DATE }}" | |
body: "Release for commit ${{ env.SHA }} on date ${{ env.DATE }}" | |
tag_name: "${{ env.TAG_NAME }}" | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |