Skip to content

Commit

Permalink
Testing github action triggering a second action
Browse files Browse the repository at this point in the history
  • Loading branch information
detro committed Oct 3, 2023
1 parent 509349a commit 9f52889
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 62 deletions.
77 changes: 40 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,43 @@ jobs:

steps:

- name: Dependencies
run: |
sudo apt update
sudo apt install -y libsasl2-dev
- name: Check-out
uses: actions/checkout@v4

- name: Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt, clippy

- name: Cargo check
uses: actions-rs/cargo@v1
with:
command: check

- name: Cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
- name: Testing CI
run: echo "This is just a test"

# - name: Dependencies
# run: |
# sudo apt update
# sudo apt install -y libsasl2-dev
#
# - name: Check-out
# uses: actions/checkout@v4
#
# - name: Toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# profile: minimal
# override: true
# components: rustfmt, clippy
#
# - name: Cargo check
# uses: actions-rs/cargo@v1
# with:
# command: check
#
# - name: Cargo fmt
# uses: actions-rs/cargo@v1
# with:
# command: fmt
# args: --all -- --check
#
# - name: Cargo clippy
# uses: actions-rs/cargo@v1
# with:
# command: clippy
# args: -- -D warnings
#
# - name: Cargo test
# uses: actions-rs/cargo@v1
# with:
# command: test
65 changes: 40 additions & 25 deletions .github/workflows/crates.io-publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
name: Creates.io Publish

on:
# Publish when tagged
push:
tags: [ "v[0-9]+.[0-9]+.[0-9]+*" ]
# # Publish when tagged
# push:
# tags: [ "v[0-9]+.[0-9]+.[0-9]+*" ]

# # Publish when triggered manually on GitHub UI
# workflow_dispatch:
# # Publish when triggered manually on GitHub UI
# workflow_dispatch:

# Run when "CI" workflow runs
workflow_run:
workflows: [ "CI" ]
types: [ completed ]
branches: [ main ]

env:
CARGO_TERM_COLOR: always
Expand All @@ -17,24 +23,33 @@ jobs:

runs-on: ubuntu-latest

steps:
# Run Publish only if the triggering workflow completed successfully,
# and the workflow ref was a "version tag" of the format "vX.Y.Z"
if: |
github.event.workflow_run.conclusion == 'success'
&&
github.ref == 'ref/tags/v[0-9]+.[0-9]+.[0-9]+*'
- name: Dependencies
run: |
sudo apt update
sudo apt install -y libsasl2-dev
- name: Check-out
uses: actions/checkout@v4

- name: Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Cargo publish
run: cargo publish --locked
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_PUBLISH_TOKEN }}
steps:
- name: Dummy echo
run: echo "Crates.io publish was triggered"

# - name: Dependencies
# run: |
# sudo apt update
# sudo apt install -y libsasl2-dev
#
# - name: Check-out
# uses: actions/checkout@v4
#
# - name: Toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# profile: minimal
# override: true
#
# - name: Cargo publish
# run: cargo publish --locked
# env:
# CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_PUBLISH_TOKEN }}

0 comments on commit 9f52889

Please sign in to comment.