Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 2 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,44 +255,7 @@ jobs:
fi

release:
runs-on: ubuntu-latest
if: github.repository == 'coralogix/protofetch' && startsWith(github.ref, 'refs/tags/')
needs: [ package, test-npm-package ]
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Publish cargo package
run: cargo publish --token ${{ env.CRATES_IO_TOKEN }}

- name: Publish npm package (cx-protofetch)
run: |
node .github/npm/prepare-package.js --package cx-protofetch
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ".npmrc"
npm publish .github/npm/dist/cx-protofetch

- name: Publish npm package (@coralogix/protofetch)
run: |
node .github/npm/prepare-package.js --package coralogix-protofetch
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ".npmrc"
npm publish .github/npm/dist/coralogix-protofetch

- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: package-*
merge-multiple: true

- name: Upload release artifacts
uses: softprops/action-gh-release@v1
with:
files: |
protofetch_aarch64-unknown-linux-musl.tar.gz
protofetch_x86_64-unknown-linux-musl.tar.gz
protofetch_aarch64-apple-darwin.tar.gz
protofetch_x86_64-apple-darwin.tar.gz
protofetch_x86_64-pc-windows-msvc.tar.gz
uses: ./.github/workflows/release.yml
secrets: inherit
79 changes: 79 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
on:
workflow_call:

name: Release

env:
CARGO_TERM_COLOR: always

jobs:
cargo:
runs-on: ubuntu-latest
if: github.repository == 'coralogix/protofetch'
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Publish cargo package
run: cargo publish --token ${{ env.CRATES_IO_TOKEN }}

npm-cx-protofetch:
runs-on: ubuntu-latest
needs: [ github ]
if: github.repository == 'coralogix/protofetch'
env:
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Publish npm package (cx-protofetch)
run: |
node .github/npm/prepare-package.js --package cx-protofetch
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ".npmrc"
npm publish .github/npm/dist/cx-protofetch

npm-coralogix-protofetch:
runs-on: ubuntu-latest
needs: [ github ]
if: github.repository == 'coralogix/protofetch'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Publish npm package (@coralogix/protofetch)
run: |
node .github/npm/prepare-package.js --package coralogix-protofetch
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ".npmrc"
npm publish .github/npm/dist/coralogix-protofetch

github:
runs-on: ubuntu-latest
if: github.repository == 'coralogix/protofetch'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: package-*
merge-multiple: true

- name: Upload release artifacts
uses: softprops/action-gh-release@v1
with:
files: |
protofetch_aarch64-unknown-linux-musl.tar.gz
protofetch_x86_64-unknown-linux-musl.tar.gz
protofetch_aarch64-apple-darwin.tar.gz
protofetch_x86_64-apple-darwin.tar.gz
protofetch_x86_64-pc-windows-msvc.tar.gz
Loading