2022-08-24 15:03:06 +00:00
|
|
|
name: "Publish development branch packages"
|
2020-12-29 12:38:20 +00:00
|
|
|
|
|
|
|
on:
|
2022-08-24 15:03:06 +00:00
|
|
|
push:
|
2020-12-29 12:38:20 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-08-24 15:03:06 +00:00
|
|
|
publish-branch:
|
2020-12-29 12:38:20 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-08-18 12:12:25 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
id-token: write
|
2020-12-29 12:38:20 +00:00
|
|
|
|
|
|
|
steps:
|
2022-08-18 12:12:25 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-08-24 15:03:06 +00:00
|
|
|
|
|
|
|
- uses: pnpm/action-setup@v2.2.2
|
|
|
|
with:
|
|
|
|
version: 7
|
2020-12-29 12:38:20 +00:00
|
|
|
|
2022-08-18 12:12:25 +00:00
|
|
|
- name: "Setup node with self-hosted npm registry"
|
|
|
|
uses: actions/setup-node@v2
|
2020-12-29 12:38:20 +00:00
|
|
|
with:
|
2022-08-18 12:12:25 +00:00
|
|
|
node-version: "16"
|
|
|
|
registry-url: "https://npm.fluence.dev"
|
2020-12-29 12:38:20 +00:00
|
|
|
|
2022-08-24 15:03:06 +00:00
|
|
|
- name: "Build packages"
|
|
|
|
run: |
|
|
|
|
pnpm i
|
|
|
|
pnpm -r build
|
2020-12-29 12:38:20 +00:00
|
|
|
|
2022-08-18 12:12:25 +00:00
|
|
|
- name: "Import secrets"
|
|
|
|
uses: hashicorp/vault-action@v2.4.2
|
|
|
|
with:
|
|
|
|
url: https://vault.fluence.dev
|
|
|
|
path: jwt/github
|
|
|
|
role: ci
|
|
|
|
method: jwt
|
|
|
|
jwtGithubAudience: "https://github.com/fluencelabs"
|
|
|
|
jwtTtl: 300
|
|
|
|
exportToken: false
|
|
|
|
secrets: |
|
|
|
|
kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN
|
|
|
|
|
|
|
|
- name: "Generate package version"
|
|
|
|
id: version
|
|
|
|
run: |
|
|
|
|
BRANCH=${GITHUB_REF#refs/heads/}
|
|
|
|
SHA=$(git rev-parse --short HEAD)
|
|
|
|
|
|
|
|
echo "::set-output name=sha::$SHA"
|
|
|
|
echo "::set-output name=branch::${BRANCH//[^a-zA-Z0-9-]/-}"
|
|
|
|
|
|
|
|
- name: "Set package version"
|
2020-12-29 12:38:20 +00:00
|
|
|
env:
|
2022-08-18 12:12:25 +00:00
|
|
|
BRANCH: ${{ steps.version.outputs.branch }}
|
|
|
|
SHA: ${{ steps.version.outputs.sha }}
|
|
|
|
RUN: ${{ github.run_number }}
|
|
|
|
ATTEMPT: ${{ github.run_attempt }}
|
|
|
|
run: |
|
2022-08-24 15:03:06 +00:00
|
|
|
for package in packages/*; do
|
|
|
|
cd $package
|
|
|
|
pnpm version prepatch --no-git-tag-version \
|
|
|
|
--preid ${{ env.BRANCH }}-${{ env.SHA }}-${{ env.RUN }}-${{ env.ATTEMPT }}
|
|
|
|
cd -
|
|
|
|
done
|
2021-09-08 08:28:22 +00:00
|
|
|
|
2022-08-18 12:12:25 +00:00
|
|
|
- name: "Publish to self-hosted npm repo"
|
2022-08-24 15:03:06 +00:00
|
|
|
run: pnpm --no-git-checks --registry https://npm.fluence.dev -r publish --tag snapshot -filter '@fluencelabs/*'
|