Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ changelog:
authors:
- dependabot
categories:
- title: 💪 Improvements
labels:
- kind/feature
- title: 💥 Breaking Changes
labels:
- breaking change
- title: 💪 Improvements
labels:
- kind/feature
- title: 🐛 Bug Fixes
labels:
- kind/bug
Expand Down
53 changes: 40 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
workflow_dispatch:

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
parse:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -84,29 +88,52 @@ jobs:
- name: Create release draft
shell: bash
run: |
set -x
gh release create "${{ github.ref }}" --generate-notes --draft
gh release upload "${{ github.ref }}" artifacts/*/*
set -euxo pipefail
state=$(gh release view "$TAG" --json isDraft --jq 'if .isDraft then "draft" else "published" end' || echo absent)
case "$state" in
published)
echo "$TAG is already published"
exit 0
;;
absent)
gh release create "$TAG" --verify-tag --generate-notes --draft
;;
esac
gh release upload "$TAG" artifacts/*/* --clobber
env:
GH_TOKEN: ${{ github.token }}
RELEASE_NAME: "${{ needs.parse.outputs.version }} Release"
TAG: ${{ github.ref_name }}

publish:
name: Publish Packages
needs: release
needs:
- parse
- release
runs-on: ubuntu-24.04
if: ${{ github.repository == 'youki-dev/youki' }}
permissions:
contents: write
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
VERSION: ${{ needs.parse.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Publish libcgroups
run: cargo publish -p libcgroups --no-verify
- name: Publish libcontainer
run: cargo publish -p libcontainer --no-verify
- name: Publish liboci-cli
run: cargo publish -p liboci-cli --no-verify
- name: Publish youki
run: cargo publish -p youki --no-verify
- name: Publish crates
shell: bash
run: |
set -euo pipefail
for crate in libcgroups libcontainer liboci-cli youki; do
index="https://index.crates.io/${crate:0:2}/${crate:2:2}/${crate}"
if curl -fsSL "$index" | jq -e --arg v "$VERSION" 'select(.vers == $v)' > /dev/null; then
echo "$crate $VERSION is already on crates.io"
else
cargo publish -p "$crate" --no-verify
fi
done
- name: Publish the GitHub release
run: gh release edit "$TAG" --draft=false
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
44 changes: 0 additions & 44 deletions .github/workflows/update_version_config.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion .tagpr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
vPrefix = true
releaseBranch = main
versionFile = -
command = just version-up 0.7.1
command = "just version-up ${TAGPR_NEXT_VERSION#v}"
minorLabels = breaking change
release = false
changelog = true
Loading