forked from turboflakes/crunch
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Zachary Frederick
committed
Jan 9, 2024
1 parent
f8ea4bb
commit ca51756
Showing
39 changed files
with
1,787 additions
and
938 deletions.
There are no files selected for viewing
This file was deleted.
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 |
---|---|---|
@@ -1,83 +1,30 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
name: Rust CI - Create Release | ||
branches: | ||
- 'dev' | ||
|
||
jobs: | ||
check: | ||
name: Create Release | ||
runs-on: ubuntu-20.04 | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Rust latest stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
|
||
- name: Run cargo test | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
CRUNCH_CONFIG_FILENAME: .env.example | ||
with: | ||
command: test | ||
|
||
- name: Run cargo build | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
CRUNCH_CONFIG_FILENAME: .env.example | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
command: build | ||
args: --release | ||
|
||
- name: Generate SHA-256 hash file | ||
run: | | ||
cd ./target/release | ||
sha256sum crunch > crunch.sha256 | ||
- name: Get Rustc version | ||
id: get_rustc | ||
run: echo ::set-output name=rustc::$(rustc -V) | ||
|
||
- name: Get Tag version | ||
id: get_tag | ||
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | ||
|
||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.get_tag.outputs.tag }} | ||
release_name: Crunch ${{ steps.get_tag.outputs.tag }} | ||
body: "Note: This release was built using `${{ steps.get_rustc.outputs.rustc }}`" | ||
draft: true | ||
prerelease: false | ||
|
||
- name: Upload crunch binary | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./target/release/crunch | ||
asset_name: crunch | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload crunch sha256 | ||
uses: actions/upload-release-asset@v1.0.1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./target/release/crunch.sha256 | ||
asset_name: crunch.sha256 | ||
asset_content_type: text/plain | ||
|
||
file: docker/devnet.dockerfile | ||
push: true | ||
tags: crunch/app:latest |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.