Return 'extra file tags' in report info (#98) #147
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
name: publish artifacts | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
tests: | |
uses: Adjective-Object/good-fences-rs-core/.github/workflows/unittest.yml@main | |
publish: | |
needs: | |
- tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.BEACHBALL_PUSH_PAT }} | |
- name: pull x86_64-unknown-linux-gnu | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings-x86_64-unknown-linux-gnu | |
- name: pull aarch64-unknown-linux-gnu | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings-aarch64-unknown-linux-gnu | |
- name: pull x86_64-apple-darwin | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings-x86_64-apple-darwin | |
- name: pull aarch64-apple-darwin | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings-aarch64-apple-darwin | |
- name: pull x86_64-pc-windows-msvc | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings-x86_64-pc-windows-msvc | |
- name: pull aarch64-pc-windows-msvc | |
uses: actions/download-artifact@v3 | |
with: | |
name: bindings-aarch64-pc-windows-msvc | |
- name: pull js files | |
uses: actions/download-artifact@v3 | |
with: | |
name: js-files | |
- name: display artifacts | |
run: ls -R | |
- name: install deps | |
run: yarn install | |
- name: copy artifacts | |
run: | | |
mkdir artifacts | |
cp *.node artifacts | |
yarn artifacts | |
- name: check changes | |
run: | | |
git remote set-url origin https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git | |
# Generate changes from beachball, including package.json version bump | |
yarn beachball bump | |
# Check if that contains changefiles | |
git diff --exit-code -- ./change | |
echo "OUTPUT_STATUS=$?" >> "$GITHUB_OUTPUT" | |
shell: bash | |
- name: Publish | |
if: ${{ steps.check_changes.outputs.OUTPUT_STATUS == 1 }} | |
run: | | |
git config user.email "mhuan13@gmail.com" | |
git config user.name "$GITHUB_ACTOR" | |
# sync new package verson to napi-managed packages (ignored by beachball) | |
yarn napi version -c package.json | |
# Commit changes and tag with a version | |
PACKAGE_VERSION=$(node -e "console.log(require('./package.json').version)") | |
git commit -am "v$PACKAGE_VERSION" | |
# Push updated branch to git main branch | |
git tag "v$PACKAGE_VERSION" | |
git push origin main --tags | |
# Publish all packages | |
yarn npm publish --tag "v$PACKAGE_VERSION" --access public --tolerate-republish | |
env: | |
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.BEACHBALL_PUSH_PAT }} | |
GITHUB_ACTOR: autobot |