Skip to content

Commit

Permalink
ci: add oci-factory publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
shipperizer committed Oct 22, 2024
1 parent 3c03717 commit 59f0d77
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,29 @@ jobs:
- name: Set output of image
id: set
run: echo "image=$image" >> "$GITHUB_OUTPUT"

oci-factory:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
# install oci-factory via golang and set path in environment
- name: Install oci-factory
run: |
sudo apt update && sudo apt install -y golang-go git
go install github.com/canonical/oci-factory/tools/cli-client/cmd/oci-factory@77149f17e36362e5180ac283614421b9e9cfc3e9
GO111MODULE=on go install github.com/mikefarah/yq/[email protected]
echo "OCI_FACTORY=$(go env GOPATH)/bin/oci-factory" >> $GITHUB_ENV
echo "YQ=$(go env GOPATH)/bin/yq" >> $GITHUB_ENV
- name: Set EOLs and version
run: |
echo EOL_STABLE=$(date -d "$(date +'%Y-%m-%d') +6 month" +%Y-%m-%d") >> $GITHUB_ENV
echo EOL_CANDIDATE=$(date -d "$(date +'%Y-%m-%d') +14 day" +%Y-%m-%d") >> $GITHUB_ENV
echo IMAGE_VERSION_STABLE=$($YQ '.version | split(".").0' rockcraft.yaml) >> $GITHUB_ENV
echo IMAGE_VERSION_CANDIDATE=$($YQ '.version' rockcraft.yaml) >> $GITHUB_ENV
- name: Release
run: |
$OCI_FACTORY upload --release track=$IMAGE_VERSION_STABLE-22.04,risk=stable,eol=$EOL_STABLE
$OCI_FACTORY upload --release track=$IMAGE_VERSION_CANDIDATE-22.04,risk=candidate,edge,eol=$EOL_CANDIDATE
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}

0 comments on commit 59f0d77

Please sign in to comment.