Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mikkel tester videre #369

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d223ace
Baby steps. Trying to make a tagged release.
spaceo Dec 6, 2023
fd7c1af
Merge pull request #1 from spaceo/DDFLSBP-328-tagged-dependencies-for…
spaceo Dec 6, 2023
94f947c
trying new "on release" method
spaceo Dec 6, 2023
7007c84
Former "on" method actually worked?
spaceo Dec 6, 2023
c9fee3d
Rename assets
spaceo Dec 6, 2023
c800d1e
Trying to use ref_name
spaceo Dec 6, 2023
4219601
Just an empty commit. Nothing to see
spaceo Dec 6, 2023
0a51f97
Handle both branch and "non-branch" -tagging
spaceo Dec 6, 2023
ba06164
Hopefully better prerelease rule
spaceo Dec 6, 2023
21cb3e8
Hopefully better prerelease rule
spaceo Dec 6, 2023
e584893
Hopefully better prerelease rule
spaceo Dec 6, 2023
2d5db53
Trying new tag on pr
spaceo Dec 6, 2023
49a92f7
Just an empty commit. Nothing to see. 1519
spaceo Dec 6, 2023
6acf79d
Missed GH token
spaceo Dec 6, 2023
92aab76
Just an empty commit. Nothing to see. 1521
spaceo Dec 6, 2023
f91db64
debugging...
spaceo Dec 6, 2023
f646639
Just an empty commit. Nothing to see. 1528
spaceo Dec 6, 2023
65f9f7f
Just an empty commit. Nothing to see. 1529
spaceo Dec 6, 2023
a954650
Merge branch 'develop' into miktest-testing-prs
spaceo Dec 6, 2023
0f55839
Trying custom tag creation
spaceo Dec 6, 2023
4f29173
Just an empty commit. Nothing to see. 1538
spaceo Dec 6, 2023
4857f8e
fixed merge blocks
spaceo Dec 6, 2023
3ab0f7c
Just an empty commit. Nothing to see. 1539
spaceo Dec 6, 2023
0d6496c
Fix broken wrokflow file
spaceo Dec 6, 2023
ec42538
Just an empty commit. Nothing to see. 1544
spaceo Dec 6, 2023
858d873
Just an empty commit. Nothing to see. 1545
spaceo Dec 6, 2023
461013b
Merge branch 'develop' into miktest-testing-prs
spaceo Dec 6, 2023
4083b94
Just an empty commit. Nothing to see. 1550
spaceo Dec 6, 2023
ab42ada
Change tag creation method
spaceo Dec 6, 2023
645905c
Use non deprecated ref param
spaceo Dec 6, 2023
b6039bb
Trying on create tags in bla bla
spaceo Dec 6, 2023
a1d35a7
Rambling
spaceo Dec 6, 2023
9a70ded
Upsert tag
spaceo Dec 6, 2023
b21b578
Upsert tag
spaceo Dec 6, 2023
28cc0d2
Just an empty commit. Nothing to see. 1700
spaceo Dec 6, 2023
654ab04
Blob 1730
spaceo Dec 6, 2023
976c739
Add vars in release-on-pr-changes workflow
spaceo Dec 6, 2023
f18630a
Merge pull request #3 from spaceo/miktest-testing-prs
spaceo Dec 6, 2023
a875cc1
Just an empty commit. Nothing to see. 1854 (#4)
spaceo Dec 6, 2023
aca7a23
Mikkel tetser videre. 2202
spaceo Dec 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 80 additions & 80 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]"
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/[email protected]"
# 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 }}
72 changes: 72 additions & 0 deletions .github/workflows/release-on-pr-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release on PR changes

on:
pull_request:

jobs:
deploy_release:
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:
node-version-file: '.nvmrc'
- run: yarn install --frozen-lockfile

- name: Building
run: yarn css:build

- name: Bundling assets
run: ./bundle.sh
env:
VERSION: ${{ env.TAG_NAME }}-${{ env.RELEASE_SHA }}

- name: Rename assets
run: |
mv dist.zip $DIST_FILENAME

- name: Delete existing releases
uses: dev-drprasad/[email protected]
with:
tag_name: ${{ env.TAG_NAME }}
github_token: ${{ secrets.GITHUB_TOKEN }}


- name: Create or update tag
uses: EndBug/latest-tag@latest
with:
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
54 changes: 54 additions & 0 deletions .github/workflows/release-on-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release on tag

on:
push:
tags:
- "*"

jobs:
deploy_release:
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:
node-version-file: '.nvmrc'
- run: yarn install --frozen-lockfile

- name: Building
run: yarn css:build

- name: Bundling assets
run: VERSION=${{ env.RELEASE_NAME }}-${{ env.RELEASE_SHA }} ./bundle.sh

- name: Rename assets
run: |
mv dist.zip ${{ env.DIST_FILENAME }}

- name: Create release
id: create-release
uses: softprops/action-gh-release@v1
with:
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 }}"
5 changes: 5 additions & 0 deletions bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Empty file added pr-test.text
Empty file.
Loading