Add Github Actions to your existing library
If you have setup your library following the template guide you can skip this page
If you already have an ArupCompute library and a Github repo setup, but you would like to set up CI/CD to deploy to ArupCompute then you can copy the template repo Github actions. On this page we will describe how to do this.
If your library was created using the template repo then you do not need to do this.
Requirements
In order to follow this guide you must:
- Have an ArupCompute dotnet 6.0 library already set up and pushed to ArupCompute
- Have a Github repo setup for your project
- Have your project set up in the same folder layout as the Sample Library
The folder structure should be set up so that the .sln
file is at the root of the repo, with the class library in a folder at the root level. If you want to have your dotnet solution and class library in a lower level folder then you will have to make changes to the Github action. That will not be covered in this guide.
Set up repo
From the Sample Library, copy the .github
and .arupcompute
folders and paste them into your repo.
There are no Github secrets that need to be set up.
Edit config files
The folders that we just copied over contain the files required for the github actions and also the files that those actions use to publish new library versions to Arup Compute.
The main file that needs to be changed is .arupcompute/workflows/config.json
. This file contains information about your library, each of these fields will need to be updated.
LibraryName
: You must change this to the name of your dotnet class library. Eg, if you class library was calledExampleLibrary
then you should changeLibraryName
toExampleLibrary
LibraryId
: This must be the id of your library. To find this, open your library on the ArupCompute website and then find the id in the url. For example, in the image below the id of the library would be7
:
UserId
: This is your ArupCompute user id (note: this is different from your Arup Staff Id). To find this, go to the ArupCompute website and click on your profile picture in the top right. Your user id will be shown above the "Logout" button. Enter this value into theUserId
section of the config.json
Description
: This must be the description of your library. This does not have to be the same as the description that you initially put for your library and it can be changed at any time
Once you have updated this file you should be able to run the build and release pipeline in the same way as a library generated from the template repo. For more on how to release a new version, see Making new library versions