Skip to content

Commit

Permalink
ci: Add workflow job to auto generation of release
Browse files Browse the repository at this point in the history
Signed-off-by: Taras Drozdovskyi <[email protected]>
  • Loading branch information
tdrozdovsky committed Feb 16, 2024
1 parent 2744f38 commit 3ca2ec6
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Containers
name: Creating release & publishing container
on:
push:
tags:
Expand Down Expand Up @@ -53,3 +53,57 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# Create Release
create-release:
permissions:
contents: write # for marvinpinto/action-automatic-releases to generate pre-release
name: Create Release
runs-on: "ubuntu-latest"

steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- uses: marvinpinto/action-automatic-releases@d68defdd11f9dcc7f52f35c1b7c236ee7513bcc1
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
title: "Edge-Orchestration ${{ github.ref_name }}"

# Generate Hashes
generate_hashes:
needs: [create-release]
runs-on: ubuntu-latest
name: Generate Hashes
outputs:
hashes: ${{ steps.hash.outputs.hashes }}
steps:
- name: Download Source Code Assets
run: |
VERSION=${{ github.ref_name }}
wget https://github.com/${{ github.repository }}/archive/refs/tags/${VERSION}.tar.gz
wget https://github.com/${{ github.repository }}/archive/refs/tags/${VERSION}.zip
mv ${VERSION}.tar.gz edge-home-orchestration-go-${VERSION:1}.tar.gz
mv ${VERSION}.zip edge-home-orchestration-go-${VERSION:1}.zip
- name: Generate hashes
id: hash
run: |
VERSION=${{ github.ref_name }}
echo "hashes=$(sha256sum edge-home-orchestration-go-${VERSION:1}.tar.gz edge-home-orchestration-go-${VERSION:1}.zip | base64 -w0)" >> "$GITHUB_OUTPUT"
provenance:
needs: [generate_hashes, create-release]
name: Generate Provenance
permissions:
actions: read # To read the workflow path.
id-token: write # To sign the provenance.
contents: write # To add assets to a release.

uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
base64-subjects: "${{ needs.generate_hashes.outputs.hashes }}"
upload-assets: true # Optional: Upload to a new release

0 comments on commit 3ca2ec6

Please sign in to comment.