fix: create project from directories #494
Workflow file for this run
This file contains 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: Build and release TerosHDL | |
on: | |
push: | |
branches: | |
- dev | |
pull_request: | |
branches: | |
- dev | |
workflow_dispatch: | |
jobs: | |
############################################################################## | |
# Build TerosHDL | |
############################################################################## | |
build: | |
name: Build .vsix | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set version stable | |
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/dev' | |
run: | | |
PACKAGE_VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[",]//g') | |
echo "version=$PACKAGE_VERSION" >> $GITHUB_ENV | |
- name: Set version dev | |
if: github.ref == 'refs/heads/dev' | |
run: | | |
now=`date +"%Y-%m-%d__%H:%M"` | |
echo "version=$now" >> $GITHUB_ENV | |
- name: Set version pull request | |
if: github.event == 'pull_request' | |
run: | | |
now=`date +"%Y-%m-%d__%H:%M"` | |
echo "version=$now" >> $GITHUB_ENV | |
- name: Prepare teroshdl | |
run: | | |
npm install | |
- name: Build | |
id: build | |
run: | | |
npm install -g @vscode/vsce | |
npm run-script package | |
file=`ls *.vsix` | |
echo ${{ env.version }} | |
file_ver="${{ env.version }}_${file}" | |
file_ver="${file_ver/:/"_"}" | |
file_ver="${file_ver/ /""}" | |
echo "${{ github.workspace }}/$file_ver" | |
ls ${{ github.workspace }} | |
mv $file ${{ github.workspace }}/$file_ver | |
- name: Build Pre Release | |
id: build-pre-release | |
run: | | |
npm install -g @vscode/vsce | |
npm run-script package-prerelease | |
file=`ls *pre-release.vsix` | |
echo ${{ env.version }} | |
file_ver="${{ env.version }}_prerelease_${file}" | |
file_ver="${file_ver/:/"_"}" | |
file_ver="${file_ver/ /""}" | |
echo "${{ github.workspace }}/$file_ver" | |
ls ${{ github.workspace }} | |
mv $file ${{ github.workspace }}/$file_ver | |
- name: Archive vsix | |
uses: actions/upload-artifact@v3 | |
with: | |
name: teroshld | |
path: | | |
*.vsix | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/dev' | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
automatic_release_tag: "${{ env.version }}" | |
files: | | |
*.vsix | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
if: github.ref == 'refs/heads/dev' | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: true | |
automatic_release_tag: latest | |
files: | | |
*.vsix |