Skip to content

Commit

Permalink
test: test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
HinsonSIDAN committed Jan 16, 2024
1 parent a91e955 commit 7874b9d
Showing 1 changed file with 59 additions and 74 deletions.
133 changes: 59 additions & 74 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,6 @@ on:
- ci/github-action

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: yarn ci

publish-crates:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.PUBLISH_KEY }}
# publish-npm:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 18
# registry-url: https://registry.npmjs.org/
# - run: yarn ci
# - run: |
# if [[ "${{ github.event.head_commit.message }}" =~ ^(docs:|chore:) ]]; then
# echo "Skipping npm publish due to commit message."
# else
# npm publish --access public
# fi
# env:
# NODE_AUTH_TOKEN: ${{secrets.PUBLISH_KEY}}

build-test:
name: Build and test (${{ matrix.os }})

Expand Down Expand Up @@ -93,41 +53,66 @@ jobs:
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3

release-please:
name: Execute release chores

permissions:
contents: write
pull-requests: write

runs-on: ubuntu-latest
needs: build-test

outputs:
created: ${{ steps.release.outputs.release_created }}

steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: rust

publish:
name: Publish to crates.io

needs: build-test
name: Publish
runs-on: ubuntu-latest
needs: release-please
if: needs.release-please.outputs.created

# environment: crates.io

steps:
- uses: actions/checkout@v3
- uses: swatinem/rust-cache@v2
- name: Checkout sources
uses: actions/checkout@v3

- name: Publish
run: >
cargo publish
--verbose
--locked
--token ${{ secrets.PUBLISH_KEY }}
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- run: |
if [[ "${{ github.event.head_commit.message }}" =~ ^(docs:|chore:) ]]; then
echo "Skipping npm publish due to commit message."
else
cargo publish --token ${PUBLISH_KEY}
fi
env:
PUBLISH_KEY: ${{ secrets.PUBLISH_KEY }}
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 18
# - run: yarn ci

# publish-crates:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# override: true
# - uses: katyo/publish-crates@v2
# with:
# registry-token: ${{ secrets.PUBLISH_KEY }}
# publish-npm:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 18
# registry-url: https://registry.npmjs.org/
# - run: yarn ci
# - run: |
# if [[ "${{ github.event.head_commit.message }}" =~ ^(docs:|chore:) ]]; then
# echo "Skipping npm publish due to commit message."
# else
# npm publish --access public
# fi
# env:
# NODE_AUTH_TOKEN: ${{secrets.PUBLISH_KEY}}

0 comments on commit 7874b9d

Please sign in to comment.