Update web-assembly.yml #19
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 Salam | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: sudo apt-get install build-essential | |
- name: Build salam for Linux | |
run: | | |
cd src | |
make run | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: salam-linux | |
path: src/salam | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build salam for macOS | |
run: | | |
cd src | |
make run | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: salam-macos | |
path: src/salam | |
# build-windows: | |
# runs-on: windows-latest | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# # - name: Cache Chocolatey packages | |
# # uses: actions/cache@v4 | |
# # with: | |
# # path: | | |
# # C:\ProgramData\chocolatey | |
# # C:\Users\runneradmin\AppData\Local\Temp\chocolatey | |
# # key: ${{ runner.os }}-chocolatey-${{ hashFiles('**/build-windows.bat') }} | |
# # restore-keys: | | |
# # ${{ runner.os }}-chocolatey | |
# - name: Set up MSVC compiler | |
# run: | | |
# choco install visualstudio2017buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional" | |
# shell: cmd | |
# - name: Build salam.exe for Windows | |
# run: | | |
# cd src | |
# build-windows.bat | |
# shell: cmd | |
# - name: Upload artifact | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: salam-windows | |
# path: src/salam.exe | |
create-release: | |
runs-on: ubuntu-latest | |
# needs: [build-linux, build-macos, build-windows] | |
needs: [build-linux, build-macos] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Create tag | |
id: create_tag | |
run: | | |
tag_name="v1.0.${{ github.run_number }}" | |
git tag $tag_name | |
git push origin $tag_name | |
- name: Download Linux artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: salam-linux | |
path: ./release | |
- name: Download macOS artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: salam-macos | |
path: ./release | |
# - name: Download Windows artifact | |
# uses: actions/download-artifact@v4 | |
# with: | |
# name: salam-windows | |
# path: ./release | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.create_tag.outputs.tag_name }} | |
files: | | |
release/salam | |
# release/salam.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |