-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into map-ranges
- Loading branch information
Showing
31 changed files
with
1,145 additions
and
309 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
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,27 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
release: | ||
name: "Release" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
environment: crates_io_release | ||
|
||
steps: | ||
- name: "Checkout Repository" | ||
uses: actions/checkout@v1 | ||
|
||
- name: "Install Python Libraries" | ||
run: python -m pip install --user -r requirements.txt | ||
working-directory: "scripts" | ||
|
||
- name: "Run release script" | ||
run: "python3 scripts/ci-release.py" | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
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,36 @@ | ||
import toml | ||
import requests | ||
import subprocess | ||
|
||
cargo_toml = toml.load("Cargo.toml") | ||
crate_version = cargo_toml["package"]["version"] | ||
print("Detected crate version " + crate_version) | ||
|
||
api_url = "https://crates.io/api/v1/crates/x86_64/" + crate_version | ||
released_version = requests.get(api_url).json() | ||
|
||
if "version" in released_version: | ||
version = released_version["version"] | ||
assert (version["crate"] == "x86_64") | ||
assert (version["num"] == crate_version) | ||
print("Version " + crate_version + " already exists on crates.io") | ||
|
||
else: | ||
print("Could not find version " + crate_version + | ||
" on crates.io; creating a new release") | ||
|
||
print(" Running `cargo publish`") | ||
subprocess.run(["cargo", "publish"], check=True) | ||
|
||
tag_name = "v" + crate_version | ||
print(" Tagging commit as " + tag_name) | ||
sha = subprocess.run(["git", "rev-parse", "HEAD"], check=True, | ||
stdout=subprocess.PIPE).stdout.decode("utf-8").strip() | ||
subprocess.run([ | ||
"gh", "api", "/repos/rust-osdev/x86_64/git/refs", | ||
"-X", "POST", "-H", "Accept: application/vnd.github.v3+json", | ||
"-F", "ref=refs/tags/" + tag_name, | ||
"-F", "sha="+sha | ||
]) | ||
|
||
print(" Done") |
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 @@ | ||
toml |
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
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
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
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
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
Oops, something went wrong.