From 35c8ad53c88dcc22472ee8445b193d0462b8283a Mon Sep 17 00:00:00 2001 From: Maciej Barelkowski Date: Fri, 30 Apr 2021 18:07:17 +0200 Subject: [PATCH] ci: migrate updates to GitHub Actions --- .github/workflows/INTEGRATION.yml | 39 +++++++++++++++++++++ .github/workflows/POST_RELEASE.yml | 52 ++++++++++++++++++++++++++++ tasks/stages/update-demo | 6 ++-- tasks/stages/update-examples | 8 ++--- tasks/stages/update-integration-test | 6 ++-- tasks/stages/update-website | 8 ++--- 6 files changed, 105 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/INTEGRATION.yml create mode 100644 .github/workflows/POST_RELEASE.yml diff --git a/.github/workflows/INTEGRATION.yml b/.github/workflows/INTEGRATION.yml new file mode 100644 index 00000000..ace483bf --- /dev/null +++ b/.github/workflows/INTEGRATION.yml @@ -0,0 +1,39 @@ +name: INTEGRATION +on: + push: + tags: + - 'v[0-9]+.*' +jobs: + integration: + + strategy: + matrix: + os: [ ubuntu-latest ] + node-version: [ 14 ] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-node- + ${{ runner.OS }}- + - name: Set TAG + run: echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + - name: Update integration test + env: + GH_AUTH: ${{ secrets.GH_AUTH }} + BPMN_IO_EMAIL: ${{ secrets.BPMN_IO_EMAIL }} + BPMN_IO_USERNAME: ${{ secrets.BPMN_IO_USERNAME }} + run: bash tasks/stages/update-integration-test diff --git a/.github/workflows/POST_RELEASE.yml b/.github/workflows/POST_RELEASE.yml new file mode 100644 index 00000000..739923a7 --- /dev/null +++ b/.github/workflows/POST_RELEASE.yml @@ -0,0 +1,52 @@ +name: POST_RELEASE +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' +jobs: + post-release: + + strategy: + matrix: + os: [ ubuntu-latest ] + node-version: [ 14 ] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-node- + ${{ runner.OS }}- + - name: Set TAG + run: echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + - name: Update demo + env: + GH_AUTH: ${{ secrets.GH_AUTH }} + BPMN_IO_EMAIL: ${{ secrets.BPMN_IO_EMAIL }} + BPMN_IO_USERNAME: ${{ secrets.BPMN_IO_USERNAME }} + BPMN_IO_DEMO_ENDPOINT: ${{ secrets.BPMN_IO_DEMO_ENDPOINT }} + run: bash tasks/stages/update-demo + - name: Update examples + env: + GH_AUTH: ${{ secrets.GH_AUTH }} + BPMN_IO_EMAIL: ${{ secrets.BPMN_IO_EMAIL }} + BPMN_IO_USERNAME: ${{ secrets.BPMN_IO_USERNAME }} + run: bash tasks/stages/update-examples + - name: Update website + env: + GH_AUTH: ${{ secrets.GH_AUTH }} + BPMN_IO_EMAIL: ${{ secrets.BPMN_IO_EMAIL }} + BPMN_IO_USERNAME: ${{ secrets.BPMN_IO_USERNAME }} + run: bash tasks/stages/update-website diff --git a/tasks/stages/update-demo b/tasks/stages/update-demo index 92a465c4..0451517a 100755 --- a/tasks/stages/update-demo +++ b/tasks/stages/update-demo @@ -9,7 +9,7 @@ CLONE_DIR="$WORKDIR/bpmn-io-demo" # create work dir mkdir -p "$WORKDIR" -git clone --depth=1 "https://$GITHUB_AUTH@github.com/$BPMN_IO_DEMO_ENDPOINT.git" "$CLONE_DIR" +git clone --depth=1 "https://$GH_AUTH@github.com/$BPMN_IO_DEMO_ENDPOINT.git" "$CLONE_DIR" cd "$CLONE_DIR" @@ -20,8 +20,8 @@ git config user.name "$BPMN_IO_USERNAME" git config push.default simple git add -A -git commit -m "deps: bump bpmn-js to $TRAVIS_TAG" -git tag "bpmn-js-$TRAVIS_TAG" +git commit -m "deps: bump bpmn-js to $TAG" +git tag "bpmn-js-$TAG" git push -q &2>/dev/null git push --tags -q &2>/dev/null diff --git a/tasks/stages/update-examples b/tasks/stages/update-examples index 886655fd..724f6cff 100755 --- a/tasks/stages/update-examples +++ b/tasks/stages/update-examples @@ -9,11 +9,11 @@ EXAMPLES_DIR="$WORKDIR/bpmn-js-examples" # create work dir mkdir -p "$WORKDIR" -git clone --depth=1 "https://$GITHUB_AUTH@github.com/bpmn-io/bpmn-js-examples.git" "$EXAMPLES_DIR" +git clone --depth=1 "https://$GH_AUTH@github.com/bpmn-io/bpmn-js-examples.git" "$EXAMPLES_DIR" cd "$EXAMPLES_DIR" -TOOLKIT_VERSION="${TRAVIS_TAG:1}" +TOOLKIT_VERSION="${TAG:1}" echo "Updating toolkit version to $TOOLKIT_VERSION" sed -i -E "s#(\"bpmn-js\": )\"[^\"]+\"#\1\"^$TOOLKIT_VERSION\"#" **/package.json @@ -27,8 +27,8 @@ if [[ "x$SKIP_COMMIT" = "x" ]]; then # add all resources git add -A - git commit -m "chore: bump examples to $TRAVIS_TAG" - git tag "$TRAVIS_TAG" + git commit -m "chore: bump examples to $TAG" + git tag "$TAG" git push -q &2>/dev/null git push --tags -q &2>/dev/null else diff --git a/tasks/stages/update-integration-test b/tasks/stages/update-integration-test index 2aad8665..cb7dae76 100755 --- a/tasks/stages/update-integration-test +++ b/tasks/stages/update-integration-test @@ -9,7 +9,7 @@ IT_DIR="$WORKDIR/bpmn-js-integration" # create work dir mkdir -p "$WORKDIR" -git clone --depth=1 "https://$GITHUB_AUTH@github.com/bpmn-io/bpmn-js-integration.git" "$IT_DIR" +git clone --depth=1 "https://$GH_AUTH@github.com/bpmn-io/bpmn-js-integration.git" "$IT_DIR" cd "$IT_DIR" @@ -20,8 +20,8 @@ git config user.name "$BPMN_IO_USERNAME" git config push.default simple git add -A -git commit -m "deps: bump bpmn-js to $TRAVIS_TAG" -git tag "$TRAVIS_TAG" +git commit -m "deps: bump bpmn-js to $TAG" +git tag "$TAG" git push -q &2>/dev/null git push --tags -q &2>/dev/null diff --git a/tasks/stages/update-website b/tasks/stages/update-website index 600437e6..0d10a09c 100755 --- a/tasks/stages/update-website +++ b/tasks/stages/update-website @@ -9,13 +9,13 @@ CLONE_DIR="$WORKDIR/bpmn.io" # create work dir mkdir -p "$WORKDIR" -git clone --depth=1 "https://$GITHUB_AUTH@github.com/bpmn-io/bpmn.io.git" "$CLONE_DIR" +git clone --depth=1 "https://$GH_AUTH@github.com/bpmn-io/bpmn.io.git" "$CLONE_DIR" cd "$CLONE_DIR" -echo "Updating toolkit version to $TRAVIS_TAG on bpmn.io" +echo "Updating toolkit version to $TAG on bpmn.io" -cat src/data/site.yml | tr "\r?\n" "\r" | sed -e "s#bpmnjs:\r version: [^\r]*\r#bpmnjs:\r version: $TRAVIS_TAG\r#" | tr "\r" "\n" > src/data/site.yml_new +cat src/data/site.yml | tr "\r?\n" "\r" | sed -e "s#bpmnjs:\r version: [^\r]*\r#bpmnjs:\r version: $TAG\r#" | tr "\r" "\n" > src/data/site.yml_new mv -f src/data/site.yml_new src/data/site.yml if [[ "x$SKIP_COMMIT" = "x" ]]; then @@ -26,7 +26,7 @@ if [[ "x$SKIP_COMMIT" = "x" ]]; then # add all resources git add -A - git commit -m "chore: bump bpmn-js to $TRAVIS_TAG" + git commit -m "chore: bump bpmn-js to $TAG" git push -q &2>/dev/null else echo "Skipping commit (SKIP_COMMIT=$SKIP_COMMIT)"