-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
151 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ name: CI | |
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
|
||
jobs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
#- v[0-9]+.[0-9]+.[0-9]+ | ||
- v[0-9]+.[0-9]+.[0-9]+-test-release | ||
|
||
jobs: | ||
get-version: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
version: ${{ steps.get-version.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: get-version | ||
run: ./ci/get-release-version.sh | ||
|
||
get-ci-artifacts: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Download artifacts | ||
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe | ||
with: | ||
workflow: ci.yml | ||
workflow_conclusion: success | ||
commit: ${{ github.sha }} | ||
event: push | ||
- name: Upload version-changelog artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: version-changelog | ||
path: version-changelog/* | ||
if-no-files-found: error | ||
- name: Upload packaged-crates artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: packaged-crates | ||
path: packaged-crates/* | ||
if-no-files-found: error | ||
|
||
create-gh-release: | ||
needs: | ||
- get-version | ||
- get-ci-artifacts | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download version-changelog artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: version-changelog | ||
- name: Download packaged-crates artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: packaged-crates | ||
- name: Create GitHub release | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
RELEASE_VERSION: ${{ needs.get-version.outputs.version }} | ||
run: | | ||
gh release create "${GITHUB_REF#refs/tags/}" \ | ||
"rsjsonnet-lang-$RELEASE_VERSION.crate" \ | ||
"rsjsonnet-front-$RELEASE_VERSION.crate" \ | ||
"rsjsonnet-$RELEASE_VERSION.crate" \ | ||
--prerelease \ | ||
--verify-tag \ | ||
--title "$RELEASE_VERSION" \ | ||
--notes-file version-changelog | ||
publish-crates: | ||
needs: create-gh-release | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Publish | ||
env: | ||
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | ||
run: ./ci/publish-crates.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Changelog | ||
|
||
## 0.1.1 (unreleased) | ||
## 0.1.1 (9999-99-99) | ||
|
||
### Changed | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,13 @@ members = [ | |
resolver = "2" | ||
|
||
[workspace.package] | ||
version = "0.1.1-pre" | ||
version = "0.1.1" | ||
authors = ["Eduardo Sánchez Muñoz <[email protected]>"] | ||
edition = "2021" | ||
rust-version = "1.74" | ||
repository = "https://github.com/eduardosm/rsjsonnet" | ||
license = "MIT OR Apache-2.0" | ||
publish = false | ||
publish = true | ||
|
||
[workspace.dependencies] | ||
rsjsonnet-front = { path = "rsjsonnet-front", version = "0.1.1-pre" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
. ci/utils.sh | ||
|
||
begin_group "Install Rust" | ||
./ci/install-rust.sh stable.txt --profile minimal -c clippy | ||
# shellcheck disable=SC1091 | ||
. "$HOME/.cargo/env" | ||
end_group | ||
|
||
begin_group "Get release version" | ||
|
||
if [[ "$GITHUB_REF" != "refs/tags/v"* ]]; then | ||
echo "Invalid ref: $GITHUB_REF" | ||
exit 1 | ||
fi | ||
|
||
tag_version="${GITHUB_REF#refs/tags/v}" | ||
tag_version="${tag_version%-test-release}" | ||
echo "Tag version: $tag_version" | ||
|
||
crate="rsjsonnet" | ||
crate_version="$(crate_version "$crate")" | ||
echo "Crate version: $crate_version" | ||
|
||
if [ "$tag_version" != "$crate_version" ]; then | ||
echo "Tag version does not match crate version" | ||
exit 1 | ||
fi | ||
|
||
echo "version=$tag_version" >> "$GITHUB_OUTPUT" | ||
end_group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
. ci/utils.sh | ||
|
||
begin_group "Install Rust" | ||
./ci/install-rust.sh stable.txt --profile minimal -c clippy | ||
# shellcheck disable=SC1091 | ||
. "$HOME/.cargo/env" | ||
end_group | ||
|
||
begin_group "Fetch dependencies" | ||
cargo fetch --locked | ||
end_group | ||
|
||
export CARGO_REGISTRY_TOKEN="$CRATES_IO_TOKEN" | ||
|
||
crates=( | ||
rsjsonnet-lang | ||
rsjsonnet-front | ||
rsjsonnet | ||
) | ||
|
||
for crate in "${crates[@]}"; do | ||
begin_group "Publish $crate" | ||
cargo publish -p "$crate" --no-verify --locked --dry-run | ||
end_group | ||
exit 0 | ||
done |