Update actions/github-script action to v7 #77
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: LipidCreator CI and Tag | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { name: "Ubuntu latest GCC and latest Mono", artifact: "LipidCreator.zip", os: ubuntu-latest, build_type: "Release", cc: "gcc", cxx: "g++" } | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Create Build Number | |
run: | | |
echo "BUILD_NUMBER=$(($GITHUB_RUN_NUMBER + 752))" >> $GITHUB_ENV | |
- name: Add and install mono PPA | |
run: | | |
sudo apt install build-essential gnupg ca-certificates && \ | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \ | |
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list && \ | |
sudo apt update && \ | |
sudo apt install mono-complete ca-certificates-mono referenceassemblies-pcl | |
- name: Build | |
run: msbuild LipidCreator.sln /p:Configuration=Release /p:Platform=x64 "/p:BuildNumber=${{ env.BUILD_NUMBER }}" | |
- name: Test | |
run: cd LipidCreator && make tests && make runtest | |
- name: Tag | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: `refs/tags/${{ env.BUILD_NUMBER }}`, | |
sha: context.sha | |
}) | |
- name: Upload Zip | |
uses: actions/upload-artifact@v2 | |
if: success() | |
with: | |
name: LipidCreator | |
path: LipidCreator/bin/x64/Release/LipidCreator.zip | |