From 46e1fe0e14127c84a91f567f0710b249df45103a Mon Sep 17 00:00:00 2001 From: kruserr <46799551+kruserr@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:10:14 +0000 Subject: [PATCH] chore(release): prepare for 0.1.10 --- .github/workflows/cd.yml | 83 ------------------- .github/workflows/ci.yml | 49 ----------- CHANGELOG.md | 23 +++++ Dockerfile | 12 --- .../.dangerously-publish.sh | 0 ci.sh => tooling/ci.sh | 0 cliff.toml => tooling/cliff.toml | 4 +- .../git-cliff-detailed.toml | 4 +- .../prepare_release.sh | 19 +++-- 9 files changed, 40 insertions(+), 154 deletions(-) delete mode 100644 Dockerfile rename .dangerously-publish.sh => tooling/.dangerously-publish.sh (100%) rename ci.sh => tooling/ci.sh (100%) rename cliff.toml => tooling/cliff.toml (97%) rename git-cliff-detailed.toml => tooling/git-cliff-detailed.toml (97%) rename prepare_release.sh => tooling/prepare_release.sh (69%) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c32cdf9..16df042 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,10 +5,6 @@ on: tags: - "v*.*.*" -env: - IMAGE_NAME: i6 - IMAGE_LATEST: docker.pkg.github.com/kruserr/i6/i6:latest - jobs: rustfmt: name: Formatting @@ -80,82 +76,3 @@ jobs: - name: Publish run: | cargo publish --token ${{ secrets.CARGO_TOKEN }} - - publish-docker: - name: Publish on GitHub Packages and Docker Hub - needs: - - rustfmt - - clippy - - test - runs-on: ubuntu-22.04 - if: github.event_name == 'push' - permissions: - contents: read - packages: write - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Build image - run: | - docker build \ - --cache-from $IMAGE_LATEST \ - --build-arg BUILDKIT_INLINE_CACHE=1 \ - --tag $IMAGE_NAME . - - name: Login to GitHub Packages - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin - - name: Push image to GitHub Packages - run: | - IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - - # Strip patch version from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION_MINOR=${VERSION%.*} - - # Strip minor version from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION_MAJOR=${VERSION_MINOR%.*} - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION_MINOR - docker push $IMAGE_ID:$VERSION_MINOR - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION_MAJOR - docker push $IMAGE_ID:$VERSION_MAJOR - - name: Login to Docker Hub - run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login docker.io -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - - name: Push image to Docker Hub - run: | - IMAGE_ID=docker.io/${{ github.repository }} - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - - # Strip patch version from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION_MINOR=${VERSION%.*} - - # Strip minor version from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION_MAJOR=${VERSION_MINOR%.*} - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION_MINOR - docker push $IMAGE_ID:$VERSION_MINOR - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION_MAJOR - docker push $IMAGE_ID:$VERSION_MAJOR diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77c86e0..75127a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,6 @@ on: branches: - main -env: - IMAGE_NAME: i6 - IMAGE_LATEST: docker.pkg.github.com/kruserr/i6/i6:latest - jobs: rustfmt: name: Formatting @@ -43,48 +39,3 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Test run: cargo test - - publish-docker: - name: Publish on GitHub Packages and Docker Hub - runs-on: ubuntu-22.04 - if: github.event_name == 'push' - permissions: - contents: read - packages: write - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Build image - run: | - docker build \ - --cache-from $IMAGE_LATEST \ - --build-arg BUILDKIT_INLINE_CACHE=1 \ - --tag $IMAGE_NAME . - - name: Login to GitHub Packages - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin - - name: Push image to GitHub Packages - run: | - IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - - # Use Docker `latest` tag convention - VERSION=latest - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION - - name: Login to Docker Hub - run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login docker.io -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - - name: Push image to Docker Hub - run: | - IMAGE_ID=docker.io/${{ github.repository }} - - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - - # Use Docker `latest` tag convention - VERSION=latest - - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/CHANGELOG.md b/CHANGELOG.md index e179f3a..84d6841 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,29 @@ All notable changes to this project will be documented in this file. +## [0.1.10] - 2024-10-08 + +### Bug Fixes + +- Update name + +### Features + +- Add pack command + +### Miscellaneous Tasks + +- Init i6-pack migration +- Init i6-pack migration +- Set up workspace +- Set up workspace +- Bump version to 0.1.10 +- Update deps + +### Styling + +- Fmt + ## [0.1.9] - 2024-09-22 ### Ci diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 03a8afc..0000000 --- a/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM docker.io/rust:1.70-slim-bookworm AS builder -RUN apt-get update && \ - apt-get install -y pkg-config libssl-dev && \ - rm -rf /var/lib/apt/lists/* -WORKDIR /usr/src/app -COPY . . -RUN cargo build --release - -FROM docker.io/debian:bookworm-slim -WORKDIR /usr/src/app -COPY --from=builder /usr/src/app/target/release/i6 ./ -CMD /usr/src/app/i6 diff --git a/.dangerously-publish.sh b/tooling/.dangerously-publish.sh similarity index 100% rename from .dangerously-publish.sh rename to tooling/.dangerously-publish.sh diff --git a/ci.sh b/tooling/ci.sh similarity index 100% rename from ci.sh rename to tooling/ci.sh diff --git a/cliff.toml b/tooling/cliff.toml similarity index 97% rename from cliff.toml rename to tooling/cliff.toml index 3358680..a607258 100644 --- a/cliff.toml +++ b/tooling/cliff.toml @@ -57,9 +57,9 @@ protect_breaking_commits = false # filter out the commits that are not matched by commit parsers filter_commits = false # glob pattern for matching git tags -tag_pattern = "v[0-9]*" +tag_pattern = "[0-9]*" # regex for skipping tags -skip_tags = "v0.1.0-beta.1" +skip_tags = "0.1.0-beta.1" # regex for ignoring tags ignore_tags = "" # sort the tags chronologically diff --git a/git-cliff-detailed.toml b/tooling/git-cliff-detailed.toml similarity index 97% rename from git-cliff-detailed.toml rename to tooling/git-cliff-detailed.toml index fed8f90..151cc2f 100644 --- a/git-cliff-detailed.toml +++ b/tooling/git-cliff-detailed.toml @@ -62,9 +62,9 @@ protect_breaking_commits = false # filter out the commits that are not matched by commit parsers filter_commits = false # glob pattern for matching git tags -tag_pattern = "v[0-9]*" +tag_pattern = "[0-9]*" # regex for skipping tags -skip_tags = "v0.1.0-beta.1" +skip_tags = "0.1.0-beta.1" # regex for ignoring tags ignore_tags = "" # sort the tags chronologically diff --git a/prepare_release.sh b/tooling/prepare_release.sh similarity index 69% rename from prepare_release.sh rename to tooling/prepare_release.sh index a988de1..c78554b 100755 --- a/prepare_release.sh +++ b/tooling/prepare_release.sh @@ -1,4 +1,10 @@ #!/usr/bin/env bash + +# Example +# ```sh +# ./prepare_release.sh 0.1.25 +# ``` + set -Eeuo pipefail ci () { @@ -8,9 +14,10 @@ ci () { } bump_version () { - # update the Cargo.toml version of the workspace + # update the Cargo.toml version of the workspaces msg="# prepare_release.sh" - sed "s/^version = .* $msg$/version = \"${1#v}\" $msg/" -i Cargo.toml + + sed "s/^version = .* $msg$/version = \"${1#v}\" $msg/" -i i6/Cargo.toml cargo check } @@ -24,7 +31,7 @@ prepare_tag () { - {% if commit.breaking %}(breaking) {% endif %}{{ commit.message | upper_first }} ({{ commit.id | truncate(length=7, end=\"\") }})\ {% endfor %} {% endfor %}" - changelog=$(git-cliff --config git-cliff-detailed.toml --unreleased --strip all) + changelog=$(git-cliff --config tooling/git-cliff-detailed.toml --unreleased --strip all) git add -A && git commit -m "chore(release): prepare for $1" @@ -33,7 +40,7 @@ prepare_tag () { git tag -v "$1" } -# takes the tag as an argument (e.g. v0.1.0) +# takes the tag as an argument (e.g. 0.1.0) if [ -n $1 ]; then if [ $1 == "init" ]; then if [ -n $2 ]; then @@ -41,7 +48,7 @@ if [ -n $1 ]; then bump_version $2 - git-cliff --tag "$2" > CHANGELOG.md + git-cliff --config tooling/cliff.toml --tag "$2" > CHANGELOG.md prepare_tag $2 else @@ -52,7 +59,7 @@ if [ -n $1 ]; then bump_version $1 - git-cliff --unreleased --tag "$1" --prepend CHANGELOG.md + git-cliff --config tooling/cliff.toml --unreleased --tag "$1" --prepend CHANGELOG.md prepare_tag $1 fi