Skip to content

Commit

Permalink
Publish oci to ghcr
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu committed Nov 10, 2023
1 parent f355582 commit 4c4aea7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ on:
tags:
- 'v*'
workflow_dispatch: # allow to manually trigger this workflow
env:
REGISTRY: ghcr.io
IMAGE_NAME: appthreat/atom
jobs:
release:
if: github.repository_owner == 'appthreat'
concurrency: release
runs-on: ubuntu-latest
permissions:
Expand All @@ -26,6 +30,17 @@ jobs:
sha512sum target/atom.zip > target/atom.zip.sha512
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload atom to ghcr
run: |
cd target
echo $GITHUB_TOKEN | oras login ghcr.io -u $GITHUB_USERNAME --password-stdin
oras push ghcr.io/$IMAGE_NAME:v1 \
--annotation-file ../ci/annotations.json \
./atom.zip:application/vnd.appthreat.atom.layer.v1+tar \
./atom.zip.sha512:application/vnd.appthreat.atom.layer.v1+tar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
Expand Down
8 changes: 8 additions & 0 deletions ci/annotations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$config": {
"org.opencontainers.image.title": "atom",
"org.opencontainers.image.vendor": "appthreat",
"org.opencontainers.image.licenses": "Apache-2.0",
"org.opencontainers.image.description": "Create atom (⚛) representation for your application, packages and libraries"
}
}
4 changes: 4 additions & 0 deletions ci/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"product": "atom",
"vendor": "appthreat"
}

0 comments on commit 4c4aea7

Please # to comment.