diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..e8079d9936 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + reviewers: + - "@nrkno/sofie-ops" diff --git a/.github/workflows/node.yaml b/.github/workflows/node.yaml index 4efe2c21d0..de08d80d01 100644 --- a/.github/workflows/node.yaml +++ b/.github/workflows/node.yaml @@ -21,9 +21,9 @@ jobs: lib-name: [timeline-state-resolver, timeline-state-resolver-types] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version-file: '.node-version' - name: Prepare Environment @@ -46,9 +46,9 @@ jobs: timeout-minutes: 15 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version-file: '.node-version' - name: Prepare Environment @@ -75,9 +75,9 @@ jobs: lib-name: [timeline-state-resolver, timeline-state-resolver-types] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Prepare Environment @@ -94,7 +94,7 @@ jobs: CI: true - name: Send coverage if: matrix.node-version == '16.x' - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: fail_ci_if_error: true # name: codecov-umbrella @@ -118,11 +118,11 @@ jobs: # - validate-dependencies steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Use Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version-file: '.node-version' - name: Check release is desired @@ -145,10 +145,10 @@ jobs: if verlt $PUBLISHED_VERSION $THIS_VERSION then echo "Publishing latest" - echo ::set-output name=tag::"latest" + echo "tag=latest" >> $GITHUB_OUTPUT else echo "Publishing hotfix" - echo ::set-output name=tag::"hotfix" + echo "tag=hotfix" >> $GITHUB_OUTPUT fi fi @@ -188,9 +188,9 @@ jobs: lib-name: [timeline-state-resolver, timeline-state-resolver-types] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version-file: '.node-version' - name: Prepare Environment @@ -221,9 +221,9 @@ jobs: lib-name: [timeline-state-resolver, timeline-state-resolver-types] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version-file: '.node-version' - name: Prepare Environment diff --git a/.github/workflows/prune-tags.yml b/.github/workflows/prune-tags.yml new file mode 100644 index 0000000000..7b8b0aa75f --- /dev/null +++ b/.github/workflows/prune-tags.yml @@ -0,0 +1,42 @@ +name: Prune GitHub repo tags + +on: + workflow_dispatch: + inputs: + older-than: + description: Tags older than the specified number of days will be deleted + required: true + ignore: + description: Regex of tags to ignore + simulation: + type: boolean + description: Simulate a run (don't delete tags) + schedule: + - cron: '0 0 * * 0' + +jobs: + prune-tags: + name: Prune tags + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout repo with all tags + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Prune tags (scheduled) + if: github.event_name == 'schedule' + uses: nrkno/sofie-github-workflows/.github/actions/tag-pruner@tag-pruner-v1 + with: + older-than: 30 + ignore: '[0-9]+\.[0-9]+\.[0-9]+.*' + simulation: false + + - name: Prune tags (manual) + if: github.event_name == 'workflow_dispatch' + uses: nrkno/sofie-github-workflows/.github/actions/tag-pruner@tag-pruner-v1 + with: + older-than: ${{ github.event.inputs.older-than }} + ignore: ${{ github.event.inputs.ignore }} + simulation: ${{ github.event.inputs.simulation }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 314fe8cdb6..ceca591d9e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -17,9 +17,9 @@ jobs: lib-name: [timeline-state-resolver, timeline-state-resolver-types] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Prepare Environment @@ -44,11 +44,11 @@ jobs: - test steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Use Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version-file: '.node-version' - name: Check release is desired @@ -58,16 +58,12 @@ jobs: echo "No Token" elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then echo "Publish nightly" - echo ::set-output name=publish::"nightly" + echo "publish=nightly" >> $GITHUB_OUTPUT else echo "Publish experimental" - echo ::set-output name=publish::"experimental" + echo "publish=experimental" >> $GITHUB_OUTPUT fi - - name: Get the Prerelease tag - id: prerelease-tag - uses: yuya-takeyama/docker-tag-from-github-ref-action@2b0614b1338c8f19dd9d3ea433ca9bc0cc7057ba - with: - remove-version-tag-prefix: false + - name: Prepare Environment if: ${{ steps.do-publish.outputs.publish }} run: | @@ -84,7 +80,7 @@ jobs: COMMIT_TIMESTAMP=$(git log -1 --pretty=format:%ct HEAD) COMMIT_DATE=$(date -d @$COMMIT_TIMESTAMP +%Y%m%d-%H%M%S) GIT_HASH=$(git rev-parse --short HEAD) - PRERELEASE_TAG=nightly-$(echo "${{ steps.prerelease-tag.outputs.tag }}" | sed -r 's/[^a-z0-9]+/-/gi') + PRERELEASE_TAG=nightly-$(echo "${{ github.ref_name }}" | sed -r 's/[^a-z0-9]+/-/gi') yarn release:bump-prerelease --no-changelog --no-commit-hooks --preid "$PRERELEASE_TAG-$COMMIT_DATE-$GIT_HASH" prerelease --yes env: CI: true