v2.4.0 #23
Workflow file for this run
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
on: | |
release: | |
types: [created] | |
name: Binary artifacts | |
jobs: | |
generate: | |
env: | |
# The version needs to match with the one used in the printer | |
PRETTIER_CORE_LIB_VERSION: 2.0.0 | |
name: Create release artifacts | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v2 | |
with: | |
path: "prettier-java" | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 10.x | |
- name: Install tools | |
run: | | |
sudo apt update | |
sudo apt install jq | |
npm i -g pkg | |
- name: Installing/Linking dependencies | |
run: | | |
cd $GITHUB_WORKSPACE/prettier-java/packages/java-parser | |
npm i | |
npm link | |
cd $GITHUB_WORKSPACE/prettier-java/packages/prettier-plugin-java | |
npm i | |
npm link java-parser | |
- name: Checkout Prettier | |
uses: actions/checkout@v2 | |
with: | |
repository: prettier/prettier | |
ref: refs/tags/${{ env.PRETTIER_CORE_LIB_VERSION }} | |
path: prettier | |
- name: Link Prettier-java to Prettier | |
# We need to give the path to the plugin for pkg | |
run: | | |
cd $GITHUB_WORKSPACE/prettier | |
npm i | |
npm link prettier-plugin-java | |
mv package.json package.json.old | |
jq '.dependencies["prettier-plugin-java"] = "./node_modules/prettier-plugin-java"' package.json.old | cat > package.json | |
- name: Build the artifacts | |
run: | | |
cd $GITHUB_WORKSPACE/prettier | |
pkg package.json -o $GITHUB_WORKSPACE/prettier-java-${GITHUB_REF##*/} --targets node10-linux-x64,node10-macos-x64,node10-win-x64 | |
- name: Upload the artifacts | |
uses: skx/github-action-publish-binaries@main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
args: "prettier-java-*" |