Skip to content

Commit

Permalink
Merge pull request #8 from AntelopeIO/antelope-3.0
Browse files Browse the repository at this point in the history
[3.0] Antelope rename changes
  • Loading branch information
arhag authored Aug 17, 2022
2 parents 2a60889 + 5a36e48 commit bf62940
Show file tree
Hide file tree
Showing 90 changed files with 16,955 additions and 2,338 deletions.
19 changes: 19 additions & 0 deletions .cicd/actions/discover-platforms-action/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2022 EOS Network Foundation (ENF)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
66 changes: 66 additions & 0 deletions .cicd/actions/discover-platforms-action/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## Discover Platform Image Names & Missing Images

This action discovers the appropriate container registry image tags for a collection of "platforms" (Dockerfiles) defined in the current repo. The returned values are based on the owner of the repo, a configured package name, and the sha256 of the Dockerfile. It will also return an array of platform names whose images are not present in the container registry so the workflow can then go on to build and push them (this action will _not_ build and push them, as most likely you'd want to parallelize them in a follow on matrix'ed job).

### Inputs

Three inputs are required:
* **platform-file** - Path to file in repository that defines platforms & dockerfiles
* **package-name** - The package name in this repo owner's container registry to look for existing container images
* **password** - Token that has read access to repository & package in container registry

Example:
```
steps:
- name: Discover Platforms
id: discover
uses: AntelopeIO/discover-platforms-action@v1
with:
platform-file: .cicd/platforms.json
password: ${{secrets.GITHUB_TOKEN}}
package-name: builder
```
Where `.cicd/platforms.json` is, for example
```json
{
"ubuntu18": {
"dockerfile": ".cicd/platforms/ubuntu18.Dockerfile"
},
"ubuntu20": {
"dockerfile": ".cicd/platforms/ubuntu20.Dockerfile"
}
}
```

### Outputs
* **platforms** - The object from the `platform-file` input (see above) but with the container image and tag added
* **missing-platforms** - An array of platforms that were not found in the container registry (could be an empty array)

Example for `platforms`:
```json
{
ubuntu18: {
dockerfile: '.cicd/platforms/ubuntu18.Dockerfile',
image: 'ghcr.io/AntelopeIO/builder:8c724d9fe6f9819d9f0bd6bdff592dd971d17bd8b69fa7fef05897b8ba7e0291'
},
ubuntu20: {
dockerfile: '.cicd.platforms/ubuntu20.Dockerfile',
image: 'ghcr.io/AntelopeIO/builder:130e29695cbbd21fe2ad5c5ba6e320888a97417ddc7baa0a7a6f7b3cd145cbd2'
}
}
```

Example `missing-platforms`:
```json
["ubuntu18", "ubuntu20"]
```
or if both tags in the above example had already existed,
```json
[]
```

### Rebuilding `dist`
```
ncc build main.mjs --license licenses.txt
```

17 changes: 17 additions & 0 deletions .cicd/actions/discover-platforms-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Discover Platforms'
description: 'Discover Platform Tags & Unbuilt Platform Tags'
inputs:
platform-file:
required: true
password:
required: true
package-name:
required: true
outputs:
missing-platforms:
description: 'Array of platforms that need to be built'
platforms:
description: 'Populated map with platform:{dockerfile, tag}'
runs:
using: 'node16'
main: 'dist/index.mjs'
Loading

0 comments on commit bf62940

Please sign in to comment.