From d223ace74d70116e1fbd3cb66d82291485a6f366 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 13:27:39 +0100 Subject: [PATCH 01/36] Baby steps. Trying to make a tagged release. --- .github/workflows/deployment.yml | 160 +++++++++++++-------------- .github/workflows/tagged-release.yml | 28 +++++ 2 files changed, 108 insertions(+), 80 deletions(-) create mode 100644 .github/workflows/tagged-release.yml diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 181ccefcf..f3183dd53 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,93 +1,93 @@ -name: Deployment +# name: Deployment -on: - push: - branches-ignore: - # Dependabot does not have permissions to create releases - - 'dependabot/**' +# on: +# push: +# branches-ignore: +# # Dependabot does not have permissions to create releases +# - 'dependabot/**' -jobs: - deploy_release: - name: "Deploy release" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - - run: yarn install --frozen-lockfile +# jobs: + # deploy_release: + # name: "Deploy release" + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-node@v4 + # with: + # node-version-file: '.nvmrc' + # - run: yarn install --frozen-lockfile - - name: Building - run: yarn css:build + # - name: Building + # run: yarn css:build - - name: Bundling assets - run: ./bundle.sh + # - name: Bundling assets + # run: ./bundle.sh - - name: Release with tag - if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 - with: - files: dist.zip + # - name: Release with tag + # if: startsWith(github.ref, 'refs/tags/') + # uses: softprops/action-gh-release@v1 + # with: + # files: dist.zip - - name: Release branch - if: startsWith(github.ref, 'refs/heads/') - uses: "marvinpinto/action-automatic-releases@v1.2.1" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - # Add prefix branch name to avoid duplicate git references. - automatic_release_tag: "release-${{ github.ref_name }}" - prerelease: true - title: ${{ github.ref_name }} - files: dist.zip + # - name: Release branch + # if: startsWith(github.ref, 'refs/heads/') + # uses: "marvinpinto/action-automatic-releases@v1.2.1" + # with: + # repo_token: "${{ secrets.GITHUB_TOKEN }}" + # # Add prefix branch name to avoid duplicate git references. + # automatic_release_tag: "release-${{ github.ref_name }}" + # prerelease: true + # title: ${{ github.ref_name }} + # files: dist.zip - deploy_npm: - name: "Deploy NPM package" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - registry-url: "https://npm.pkg.github.com" - scope: "@${{ github.repository_owner }}" + # deploy_npm: + # name: "Deploy NPM package" + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-node@v4 + # with: + # node-version-file: '.nvmrc' + # registry-url: "https://npm.pkg.github.com" + # scope: "@${{ github.repository_owner }}" - - run: yarn install --frozen-lockfile + # - run: yarn install --frozen-lockfile - - name: Building - run: yarn css:build + # - name: Building + # run: yarn css:build - - name: Bundling assets - run: ./bundle.sh + # - name: Bundling assets + # run: ./bundle.sh - - name: Modify package.json for local context - # Values in package.json must match the current GitHub repository to - # publish to it. - run: | - npm exec -- json -I -f package.json -e "this.name='@$GITHUB_REPOSITORY'" - npm exec -- json -I -f package.json -e "this.repository='https://github.com/$GITHUB_REPOSITORY'" + # - name: Modify package.json for local context + # # Values in package.json must match the current GitHub repository to + # # publish to it. + # run: | + # npm exec -- json -I -f package.json -e "this.name='@$GITHUB_REPOSITORY'" + # npm exec -- json -I -f package.json -e "this.repository='https://github.com/$GITHUB_REPOSITORY'" - - name: Release branch - if: startsWith(github.ref, 'refs/heads/') - # Version 0.0.0-SHA is a schema that supports semantic versioning but - # should sink below proper versions. - # Output package.json to provide insight and help debugging - # Using branch names as tags allows other projects to track unreleased - # development. - run: | - NPM_TAG_NAME=$(echo $GITHUB_REF_NAME | tr -d [:space:] | tr -C [:alnum:] -) - npm version 0.0.0-$GITHUB_SHA --no-git-tag-version - echo $NPM_TAG_NAME - cat package.json - npm publish --tag $NPM_TAG_NAME - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Release branch + # if: startsWith(github.ref, 'refs/heads/') + # # Version 0.0.0-SHA is a schema that supports semantic versioning but + # # should sink below proper versions. + # # Output package.json to provide insight and help debugging + # # Using branch names as tags allows other projects to track unreleased + # # development. + # run: | + # NPM_TAG_NAME=$(echo $GITHUB_REF_NAME | tr -d [:space:] | tr -C [:alnum:] -) + # npm version 0.0.0-$GITHUB_SHA --no-git-tag-version + # echo $NPM_TAG_NAME + # cat package.json + # npm publish --tag $NPM_TAG_NAME + # env: + # NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Release with tag - if: startsWith(github.ref, 'refs/tags/') - # The latest tag follows tagged versions to follow NPM conventions. - run: | - npm version $GITHUB_REF_NAME --no-git-tag-version - cat package.json - npm publish --tag latest - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Release with tag + # if: startsWith(github.ref, 'refs/tags/') + # # The latest tag follows tagged versions to follow NPM conventions. + # run: | + # npm version $GITHUB_REF_NAME --no-git-tag-version + # cat package.json + # npm publish --tag latest + # env: + # NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml new file mode 100644 index 000000000..50e9ce27a --- /dev/null +++ b/.github/workflows/tagged-release.yml @@ -0,0 +1,28 @@ +name: Deployment + +on: + push: + tags: + - "*.*.*" + +jobs: + deploy_release: + name: "Deploy release" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + - run: yarn install --frozen-lockfile + + - name: Building + run: yarn css:build + + - name: Bundling assets + run: ./bundle.sh + + - name: Release with tag + uses: softprops/action-gh-release@v1 + with: + files: dist.zip From 94f947c524bc71cb126802509cd061d691d036b0 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 13:33:29 +0100 Subject: [PATCH 02/36] trying new "on release" method --- .github/workflows/tagged-release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml index 50e9ce27a..45f6e0703 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/tagged-release.yml @@ -1,9 +1,8 @@ name: Deployment on: - push: - tags: - - "*.*.*" + release: + types: [published] jobs: deploy_release: From 7007c846fa795b8134ebdc8f236fab09dab9f1ae Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 13:36:02 +0100 Subject: [PATCH 03/36] Former "on" method actually worked? --- .github/workflows/tagged-release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml index 45f6e0703..00780e940 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/tagged-release.yml @@ -1,8 +1,9 @@ -name: Deployment +name: Tagged release on: - release: - types: [published] + push: + tags: + - "*.*.*" jobs: deploy_release: From c9fee3de692e702f7fceedfa7bac211c7b0524de Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 13:51:55 +0100 Subject: [PATCH 04/36] Rename assets --- .github/workflows/tagged-release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml index 00780e940..35f8ff035 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/tagged-release.yml @@ -22,7 +22,11 @@ jobs: - name: Bundling assets run: ./bundle.sh + - name: Rename assets + run: | + mv dist.zip dist-${{ github.ref }}-${{ github.sha }}.zip + - name: Release with tag uses: softprops/action-gh-release@v1 with: - files: dist.zip + files: dist-${{ github.ref }}-${{ github.sha }}.zip From c800d1e8a0c24c96fc588baeafc9cbbeaac362aa Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 13:55:18 +0100 Subject: [PATCH 05/36] Trying to use ref_name --- .github/workflows/tagged-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml index 35f8ff035..ecbddb502 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/tagged-release.yml @@ -24,9 +24,9 @@ jobs: - name: Rename assets run: | - mv dist.zip dist-${{ github.ref }}-${{ github.sha }}.zip + mv dist.zip dist-${{ github.ref_name }}-${{ github.sha }}.zip - name: Release with tag uses: softprops/action-gh-release@v1 with: - files: dist-${{ github.ref }}-${{ github.sha }}.zip + files: dist-${{ github.ref_name }}-${{ github.sha }}.zip From 42196014fc1a7cc50b3a24579ef705161b6a76c4 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 14:07:59 +0100 Subject: [PATCH 06/36] Just an empty commit. Nothing to see From 0a51f97a1af6256b44c827f438eb219ebbc4f490 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 14:47:10 +0100 Subject: [PATCH 07/36] Handle both branch and "non-branch" -tagging --- .../workflows/{tagged-release.yml => release-on-tag.yml} | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename .github/workflows/{tagged-release.yml => release-on-tag.yml} (83%) diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/release-on-tag.yml similarity index 83% rename from .github/workflows/tagged-release.yml rename to .github/workflows/release-on-tag.yml index ecbddb502..ff9e8f24a 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/release-on-tag.yml @@ -1,9 +1,9 @@ -name: Tagged release +name: Release on tag on: push: tags: - - "*.*.*" + - "*" jobs: deploy_release: @@ -26,7 +26,8 @@ jobs: run: | mv dist.zip dist-${{ github.ref_name }}-${{ github.sha }}.zip - - name: Release with tag + - name: Create release uses: softprops/action-gh-release@v1 with: + prerelease: startsWith(github.ref, 'refs/tags/branch') files: dist-${{ github.ref_name }}-${{ github.sha }}.zip From ba06164337fdd20db045b8b25ceae18f79059da7 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 14:54:51 +0100 Subject: [PATCH 08/36] Hopefully better prerelease rule --- .github/workflows/release-on-tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index ff9e8f24a..2d1d8d0be 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -29,5 +29,5 @@ jobs: - name: Create release uses: softprops/action-gh-release@v1 with: - prerelease: startsWith(github.ref, 'refs/tags/branch') + prerelease: startsWith(github.ref_name, 'branch-') files: dist-${{ github.ref_name }}-${{ github.sha }}.zip From 21cb3e857d1ce24584212338825c2b49f908c10d Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 14:57:50 +0100 Subject: [PATCH 09/36] Hopefully better prerelease rule --- .github/workflows/release-on-tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index 2d1d8d0be..46a28a1e4 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -29,5 +29,5 @@ jobs: - name: Create release uses: softprops/action-gh-release@v1 with: - prerelease: startsWith(github.ref_name, 'branch-') + prerelease: {{ startsWith(github.ref_name, 'branch-') }} files: dist-${{ github.ref_name }}-${{ github.sha }}.zip From e58489388117ce8d4cc19525f53d5b283c8acf4c Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:01:22 +0100 Subject: [PATCH 10/36] Hopefully better prerelease rule --- .github/workflows/release-on-tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index 46a28a1e4..8dcafb1b8 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -29,5 +29,5 @@ jobs: - name: Create release uses: softprops/action-gh-release@v1 with: - prerelease: {{ startsWith(github.ref_name, 'branch-') }} + prerelease: ${{ startsWith(github.ref_name, 'branch-') }} files: dist-${{ github.ref_name }}-${{ github.sha }}.zip From 2d5db5371d859bf8894ca9f3aac7a14ac3a49e54 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:18:44 +0100 Subject: [PATCH 11/36] Trying new tag on pr --- .github/workflows/tag-on-pr.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/tag-on-pr.yml diff --git a/.github/workflows/tag-on-pr.yml b/.github/workflows/tag-on-pr.yml new file mode 100644 index 000000000..cd7cd3410 --- /dev/null +++ b/.github/workflows/tag-on-pr.yml @@ -0,0 +1,15 @@ +name: Tag on PR + +on: + pull_request: + +jobs: + create_tag_on_pr_changes: + name: "Create tag on PR changes" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Tumdidum + uses: mathieudutour/github-tag-action@v6.1 + with: + custom_tag: ${{ github.ref_name }} From 49a92f77ee5510ebfecf99f0a0a0b0cde794c266 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:19:52 +0100 Subject: [PATCH 12/36] Just an empty commit. Nothing to see. 1519 From 6acf79db4f6ef90fe211f2f4a70db271ef607d3e Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:21:32 +0100 Subject: [PATCH 13/36] Missed GH token --- .github/workflows/tag-on-pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tag-on-pr.yml b/.github/workflows/tag-on-pr.yml index cd7cd3410..593aa5792 100644 --- a/.github/workflows/tag-on-pr.yml +++ b/.github/workflows/tag-on-pr.yml @@ -12,4 +12,5 @@ jobs: - name: Tumdidum uses: mathieudutour/github-tag-action@v6.1 with: + github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ github.ref_name }} From 92aab76a47141035ab0d358ea4e5946196dc8eb0 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:21:54 +0100 Subject: [PATCH 14/36] Just an empty commit. Nothing to see. 1521 From f91db64c81c3de1b4d72112c64561b96390961a6 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:27:08 +0100 Subject: [PATCH 15/36] debugging... --- .github/workflows/tag-on-pr.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tag-on-pr.yml b/.github/workflows/tag-on-pr.yml index cd7cd3410..7cccfb4db 100644 --- a/.github/workflows/tag-on-pr.yml +++ b/.github/workflows/tag-on-pr.yml @@ -9,7 +9,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + + - name: Mikdebug + run: echo ${{ github.event.pull_request.head.ref }} + - name: Tumdidum uses: mathieudutour/github-tag-action@v6.1 with: - custom_tag: ${{ github.ref_name }} + custom_tag: ${{ github.event.pull_request.head.ref }} From f6466398a923f7f4bb939cd4435044f3719a67aa Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:28:45 +0100 Subject: [PATCH 16/36] Just an empty commit. Nothing to see. 1528 From 65f9f7f9244c1a02d2e886286e100489b7b3dd3f Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:29:38 +0100 Subject: [PATCH 17/36] Just an empty commit. Nothing to see. 1529 From 0f5583976308c387f44f7eaef86fb6b24e949c0c Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:37:37 +0100 Subject: [PATCH 18/36] Trying custom tag creation --- .github/workflows/tag-on-pr.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/tag-on-pr.yml b/.github/workflows/tag-on-pr.yml index 593aa5792..417413b9e 100644 --- a/.github/workflows/tag-on-pr.yml +++ b/.github/workflows/tag-on-pr.yml @@ -9,8 +9,29 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 +<<<<<<< Updated upstream - name: Tumdidum uses: mathieudutour/github-tag-action@v6.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ github.ref_name }} +======= + + - name: Mikdebug + run: echo ${{ github.event.pull_request.head.ref }} + + # - name: Tumdidum + # uses: mathieudutour/github-tag-action@v6.1 + # with: + # custom_tag: ${{ github.event.pull_request.head.ref }} + # github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Tumdidum 2 + + - name: Push Git Tag + run: | + TAG=$(echo ${{ github.event.pull_request.head.ref }}) + git config user.name "GitHub Actions" + git config user.email "github-actions@users.noreply.github.com" + git tag ${{ github.event.pull_request.head.ref }} + git push origin $TAG +>>>>>>> Stashed changes From 4f29173deb6b5ae5377c410792d3645a4cc696f3 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:38:04 +0100 Subject: [PATCH 19/36] Just an empty commit. Nothing to see. 1538 From 4857f8ee33caf2fad0101169d72d668060f6cf27 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:39:41 +0100 Subject: [PATCH 20/36] fixed merge blocks --- .github/workflows/tag-on-pr.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/tag-on-pr.yml b/.github/workflows/tag-on-pr.yml index 417413b9e..b16a02b77 100644 --- a/.github/workflows/tag-on-pr.yml +++ b/.github/workflows/tag-on-pr.yml @@ -9,13 +9,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 -<<<<<<< Updated upstream - - name: Tumdidum - uses: mathieudutour/github-tag-action@v6.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - custom_tag: ${{ github.ref_name }} -======= - name: Mikdebug run: echo ${{ github.event.pull_request.head.ref }} @@ -34,4 +27,3 @@ jobs: git config user.email "github-actions@users.noreply.github.com" git tag ${{ github.event.pull_request.head.ref }} git push origin $TAG ->>>>>>> Stashed changes From 3ab0f7ccf0033c283fae5909449ff9dfb628a634 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:39:53 +0100 Subject: [PATCH 21/36] Just an empty commit. Nothing to see. 1539 From 0d6496c852d96083e1cf38057b1bf03504d10b4f Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:43:38 +0100 Subject: [PATCH 22/36] Fix broken wrokflow file --- .github/workflows/tag-on-pr.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/tag-on-pr.yml b/.github/workflows/tag-on-pr.yml index b16a02b77..71bd12053 100644 --- a/.github/workflows/tag-on-pr.yml +++ b/.github/workflows/tag-on-pr.yml @@ -13,13 +13,6 @@ jobs: - name: Mikdebug run: echo ${{ github.event.pull_request.head.ref }} - # - name: Tumdidum - # uses: mathieudutour/github-tag-action@v6.1 - # with: - # custom_tag: ${{ github.event.pull_request.head.ref }} - # github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Tumdidum 2 - - name: Push Git Tag run: | TAG=$(echo ${{ github.event.pull_request.head.ref }}) From ec42538808e112a679e97a91d54a50340bd27fb0 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:44:43 +0100 Subject: [PATCH 23/36] Just an empty commit. Nothing to see. 1544 From 858d873d16ad75e110e42c36726cad927f8151d8 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:46:01 +0100 Subject: [PATCH 24/36] Just an empty commit. Nothing to see. 1545 From 4083b94fcc651a2cc8fbb6b7406526bf4a93bd06 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:50:24 +0100 Subject: [PATCH 25/36] Just an empty commit. Nothing to see. 1550 From ab42ada88b2dd56ebec6b7d9d830451fc5c4e000 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:54:33 +0100 Subject: [PATCH 26/36] Change tag creation method --- .github/workflows/tag-on-pr.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tag-on-pr.yml b/.github/workflows/tag-on-pr.yml index 71bd12053..61e086884 100644 --- a/.github/workflows/tag-on-pr.yml +++ b/.github/workflows/tag-on-pr.yml @@ -13,10 +13,7 @@ jobs: - name: Mikdebug run: echo ${{ github.event.pull_request.head.ref }} - - name: Push Git Tag - run: | - TAG=$(echo ${{ github.event.pull_request.head.ref }}) - git config user.name "GitHub Actions" - git config user.email "github-actions@users.noreply.github.com" - git tag ${{ github.event.pull_request.head.ref }} - git push origin $TAG + - name: Create or update tag + uses: EndBug/latest-tag@latest + with: + tag-name: ${{ github.event.pull_request.head.ref }} From 645905ca63d227e204ab2c6f0ef151cc2dc7eb54 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 15:56:30 +0100 Subject: [PATCH 27/36] Use non deprecated ref param --- .github/workflows/tag-on-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-on-pr.yml b/.github/workflows/tag-on-pr.yml index 61e086884..2d1ab2dff 100644 --- a/.github/workflows/tag-on-pr.yml +++ b/.github/workflows/tag-on-pr.yml @@ -16,4 +16,4 @@ jobs: - name: Create or update tag uses: EndBug/latest-tag@latest with: - tag-name: ${{ github.event.pull_request.head.ref }} + ref: ${{ github.event.pull_request.head.ref }} From b6039bbc36b4c809c2cf4c2baaf1bf844ae13dd3 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 16:10:05 +0100 Subject: [PATCH 28/36] Trying on create tags in bla bla --- .github/workflows/release-on-tag.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index 8dcafb1b8..31b4c7a98 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -1,6 +1,9 @@ name: Release on tag on: + create: + tags: + - "*" push: tags: - "*" From a1d35a7a147e62e458cc5d643fba1c1270d8f932 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 16:43:49 +0100 Subject: [PATCH 29/36] Rambling --- .github/workflows/release-on-pr-changes.yml | 39 +++++++++++++++++++++ .github/workflows/release-on-tag.yml | 4 --- .github/workflows/tag-on-pr.yml | 19 ---------- 3 files changed, 39 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/release-on-pr-changes.yml delete mode 100644 .github/workflows/tag-on-pr.yml diff --git a/.github/workflows/release-on-pr-changes.yml b/.github/workflows/release-on-pr-changes.yml new file mode 100644 index 000000000..f66a91044 --- /dev/null +++ b/.github/workflows/release-on-pr-changes.yml @@ -0,0 +1,39 @@ +name: Release on PR changes + +on: + pull_request: + +jobs: + deploy_release: + name: "Deploy release" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + - run: yarn install --frozen-lockfile + + - name: Building + run: yarn css:build + + - name: Bundling assets + run: ./bundle.sh + + - name: Rename assets + run: | + mv dist.zip dist-${{ github.event.pull_request.head.ref }}-${{ github.sha }}.zip + + - name: Delete existing releases + uses: dev-drprasad/delete-tag-and-release@v1.0 + with: + tag_name: ${{ github.event.pull_request.head.ref }} + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create release + uses: softprops/action-gh-release@v1 + with: + prerelease: true + files: dist-${{ github.event.pull_request.head.ref }}-${{ github.sha }}.zip + + diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index 31b4c7a98..22b604d6d 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -1,9 +1,6 @@ name: Release on tag on: - create: - tags: - - "*" push: tags: - "*" @@ -32,5 +29,4 @@ jobs: - name: Create release uses: softprops/action-gh-release@v1 with: - prerelease: ${{ startsWith(github.ref_name, 'branch-') }} files: dist-${{ github.ref_name }}-${{ github.sha }}.zip diff --git a/.github/workflows/tag-on-pr.yml b/.github/workflows/tag-on-pr.yml deleted file mode 100644 index 2d1ab2dff..000000000 --- a/.github/workflows/tag-on-pr.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Tag on PR - -on: - pull_request: - -jobs: - create_tag_on_pr_changes: - name: "Create tag on PR changes" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Mikdebug - run: echo ${{ github.event.pull_request.head.ref }} - - - name: Create or update tag - uses: EndBug/latest-tag@latest - with: - ref: ${{ github.event.pull_request.head.ref }} From 9a70deddfee6b17770a24714b39b37a248a61476 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 16:53:46 +0100 Subject: [PATCH 30/36] Upsert tag --- .github/workflows/release-on-pr-changes.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release-on-pr-changes.yml b/.github/workflows/release-on-pr-changes.yml index f66a91044..a3d30aca4 100644 --- a/.github/workflows/release-on-pr-changes.yml +++ b/.github/workflows/release-on-pr-changes.yml @@ -30,6 +30,11 @@ jobs: tag_name: ${{ github.event.pull_request.head.ref }} github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Create or update tag + uses: EndBug/latest-tag@latest + with: + ref: ${{ github.event.pull_request.head.ref }} + - name: Create release uses: softprops/action-gh-release@v1 with: From b21b578ddb4ac2c5903f64b5c5e2b868f875f743 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 16:57:27 +0100 Subject: [PATCH 31/36] Upsert tag --- .github/workflows/release-on-pr-changes.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-on-pr-changes.yml b/.github/workflows/release-on-pr-changes.yml index a3d30aca4..8b6f25cba 100644 --- a/.github/workflows/release-on-pr-changes.yml +++ b/.github/workflows/release-on-pr-changes.yml @@ -39,6 +39,7 @@ jobs: uses: softprops/action-gh-release@v1 with: prerelease: true + tag_name: ${{ github.event.pull_request.head.ref }} files: dist-${{ github.event.pull_request.head.ref }}-${{ github.sha }}.zip From 28cc0d2c41bb4f726ab0b2cad198aaab1e3562ad Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 17:00:25 +0100 Subject: [PATCH 32/36] Just an empty commit. Nothing to see. 1700 From 654ab04c77845e54cc5dddae8696838a7ba8a8d4 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 17:30:37 +0100 Subject: [PATCH 33/36] Blob 1730 --- .github/workflows/release-on-pr-changes.yml | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-on-pr-changes.yml b/.github/workflows/release-on-pr-changes.yml index 8b6f25cba..23b7ed5ea 100644 --- a/.github/workflows/release-on-pr-changes.yml +++ b/.github/workflows/release-on-pr-changes.yml @@ -30,16 +30,16 @@ jobs: tag_name: ${{ github.event.pull_request.head.ref }} github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Create or update tag - uses: EndBug/latest-tag@latest - with: - ref: ${{ github.event.pull_request.head.ref }} - - - name: Create release - uses: softprops/action-gh-release@v1 - with: - prerelease: true - tag_name: ${{ github.event.pull_request.head.ref }} - files: dist-${{ github.event.pull_request.head.ref }}-${{ github.sha }}.zip + # - name: Create or update tag + # uses: EndBug/latest-tag@latest + # with: + # ref: ${{ github.event.pull_request.head.ref }} + + # - name: Create release + # uses: softprops/action-gh-release@v1 + # with: + # prerelease: true + # tag_name: ${{ github.event.pull_request.head.ref }} + # files: dist-${{ github.event.pull_request.head.ref }}-${{ github.sha }}.zip From 976c739c474764c19c837e5b4413121eb55a8abe Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 18:24:49 +0100 Subject: [PATCH 34/36] Add vars in release-on-pr-changes workflow --- .github/workflows/release-on-pr-changes.yml | 35 +++++++++++++-------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release-on-pr-changes.yml b/.github/workflows/release-on-pr-changes.yml index 23b7ed5ea..37a0f6eb7 100644 --- a/.github/workflows/release-on-pr-changes.yml +++ b/.github/workflows/release-on-pr-changes.yml @@ -20,26 +20,35 @@ jobs: - name: Bundling assets run: ./bundle.sh + - name: Set release name + id: resolve-release-vars + run: | + RELEASE=$(echo ${{ github.event.pull_request.head.ref }}) + TAG_NAME=$(echo "branch-${RELEASE}") + echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" + echo "DIST_FILENAME=dist-${{ github.event.pull_request.head.ref }}-${{ github.sha }}.zip" >> "$GITHUB_ENV" + - name: Rename assets run: | - mv dist.zip dist-${{ github.event.pull_request.head.ref }}-${{ github.sha }}.zip + mv dist.zip $DIST_FILENAME - name: Delete existing releases uses: dev-drprasad/delete-tag-and-release@v1.0 with: - tag_name: ${{ github.event.pull_request.head.ref }} + tag_name: ${{ env.TAG_NAME }} github_token: ${{ secrets.GITHUB_TOKEN }} - # - name: Create or update tag - # uses: EndBug/latest-tag@latest - # with: - # ref: ${{ github.event.pull_request.head.ref }} - - # - name: Create release - # uses: softprops/action-gh-release@v1 - # with: - # prerelease: true - # tag_name: ${{ github.event.pull_request.head.ref }} - # files: dist-${{ github.event.pull_request.head.ref }}-${{ github.sha }}.zip + + - name: Create or update tag + uses: EndBug/latest-tag@latest + with: + ref: ${{ env.TAG_NAME }} + + - name: Create release + uses: softprops/action-gh-release@v1 + with: + prerelease: true + tag_name: ${{ env.TAG_NAME }} + files: ${{ env.DIST_FILENAME }} From a875cc1b84fc38aee3881543cbcb701bfbac4529 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 22:01:30 +0100 Subject: [PATCH 35/36] Just an empty commit. Nothing to see. 1854 (#4) * Just an empty commit. Nothing to see. 1854 * pr-test.text * Trying to create correct releases * Trying to create correct releases * Adding version info in builds * Messing with release sha * Messing with summary * Messing with release desc * Messing with release desc * Messing with release desc * Some body text * Some body text * Try to get the right release desc * Reorder steps * Use vars in release-on-tag * Tidying up vars in release-on-pr-changes * Adding summary to release-on-tag * set bundle step env separately * Correct env var references * bla bla * bli bli * bli blu * bli blu bla * bli blu bla bla * bli blu bla bla X 5 * bli blu bla bla X 10 --- .github/workflows/release-on-pr-changes.yml | 36 +++++++++++++++------ .github/workflows/release-on-tag.yml | 28 ++++++++++++++-- bundle.sh | 5 +++ pr-test.text | 0 4 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 pr-test.text diff --git a/.github/workflows/release-on-pr-changes.yml b/.github/workflows/release-on-pr-changes.yml index 37a0f6eb7..ef9a2b39e 100644 --- a/.github/workflows/release-on-pr-changes.yml +++ b/.github/workflows/release-on-pr-changes.yml @@ -8,6 +8,25 @@ jobs: name: "Deploy release" runs-on: ubuntu-latest steps: + - name: Set release variables + id: resolve-release-vars + run: | + RELEASE_BRANCH=${{ github.event.pull_request.head.ref }} + RELEASE_SHA=${{ github.event.pull_request.head.sha }} + TAG_NAME=$(echo "branch-${RELEASE_BRANCH}") + echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> "$GITHUB_ENV" + echo "RELEASE_SHA=$RELEASE_SHA" >> "$GITHUB_ENV" + echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" + echo "DIST_FILENAME=dist-$RELEASE_BRANCH-$RELEASE_SHA.zip" >> "$GITHUB_ENV" + + # Checkout the HEAD of the PR branch to get the latest commit message. + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Get release description + run: | + echo "RELEASE_DESCRIPTION=$(git show -s --format=%s)" >> "$GITHUB_ENV" + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: @@ -19,14 +38,8 @@ jobs: - name: Bundling assets run: ./bundle.sh - - - name: Set release name - id: resolve-release-vars - run: | - RELEASE=$(echo ${{ github.event.pull_request.head.ref }}) - TAG_NAME=$(echo "branch-${RELEASE}") - echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" - echo "DIST_FILENAME=dist-${{ github.event.pull_request.head.ref }}-${{ github.sha }}.zip" >> "$GITHUB_ENV" + env: + VERSION: ${{ env.TAG_NAME }}-${{ env.RELEASE_SHA }} - name: Rename assets run: | @@ -45,10 +58,15 @@ jobs: ref: ${{ env.TAG_NAME }} - name: Create release + id: create-release uses: softprops/action-gh-release@v1 with: prerelease: true + target_commitish: ${{ env.RELEASE_SHA }} tag_name: ${{ env.TAG_NAME }} + body: ${{ env.RELEASE_DESCRIPTION }} files: ${{ env.DIST_FILENAME }} - + - name: Adding summary + run: | + echo "Release created 🚀😎 at: ${{ steps.create-release.outputs.url }}" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index 22b604d6d..8cb194d63 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -10,6 +10,15 @@ jobs: name: "Deploy release" runs-on: ubuntu-latest steps: + - name: Set release variables + id: resolve-release-vars + run: | + RELEASE_NAME=${{ github.ref_name }} + RELEASE_SHA=${{ github.sha }} + echo "RELEASE_NAME=$RELEASE_NAME" >> "$GITHUB_ENV" + echo "RELEASE_SHA=$RELEASE_SHA" >> "$GITHUB_ENV" + echo "DIST_FILENAME=dist-$RELEASE_NAME-$RELEASE_SHA.zip" >> "$GITHUB_ENV" + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: @@ -20,13 +29,26 @@ jobs: run: yarn css:build - name: Bundling assets - run: ./bundle.sh + run: VERSION=${{ env.RELEASE_NAME }}-${{ env.RELEASE_SHA }} ./bundle.sh - name: Rename assets run: | - mv dist.zip dist-${{ github.ref_name }}-${{ github.sha }}.zip + mv dist.zip ${{ env.DIST_FILENAME }} - name: Create release + id: create-release uses: softprops/action-gh-release@v1 with: - files: dist-${{ github.ref_name }}-${{ github.sha }}.zip + files: ${{ env.DIST_FILENAME }} + + - name: Mikdebug 1 + run: | + echo "Release created 🚀😎 at: ${{ steps.create-release.outputs.url }}" + + - name: Adding summary + run: | + echo "Release created 🚀😎 at: ${{ steps.create-release.outputs.url }}" >> $GITHUB_STEP_SUMMARY + + - name: Mikdebug 2 + run: | + echo "Release created 🚀😎 at: ${{ steps.create-release.outputs.url }}" diff --git a/bundle.sh b/bundle.sh index 134bd1a7a..29187be37 100755 --- a/bundle.sh +++ b/bundle.sh @@ -6,4 +6,9 @@ cp -r ./public/icons ./build/icons cp -r ./src/styles/css ./build/css cp -r ./src/styles/fonts ./build/fonts find ./src -name "*.js" -exec cp {} ./build/js \; + +if [ -n "$VERSION" ]; then + echo $VERSION > ./build/version.txt +fi + zip -r dist.zip build/ diff --git a/pr-test.text b/pr-test.text new file mode 100644 index 000000000..e69de29bb From aca7a235972fe38ed82d8d4ed95744ef4abeca2a Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Wed, 6 Dec 2023 22:02:52 +0100 Subject: [PATCH 36/36] Mikkel tetser videre. 2202