Skip to content

chore: update act (submodule) #444

chore: update act (submodule)

chore: update act (submodule) #444

name: Build act with patches
on: [push, workflow_dispatch]
jobs:
calculate-tag:
runs-on: ubuntu-latest
outputs:
versionHash: ${{ steps.release-tag.outputs.versionHash }}
latestHash: ${{ steps.release-tag.outputs.latestHash }}
tag: ${{ steps.release-tag.outputs.tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- id: release-tag
name: compute release tag
run: |
./compute-release-tag.sh
build:
runs-on: ubuntu-latest
needs: [calculate-tag]
if: needs.calculate-tag.outputs.versionHash != needs.calculate-tag.outputs.latestHash
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: setup git
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- uses: actions/setup-go@v3
with:
go-version-file: act/go.mod
- name: compile
run: |
make act-build
test:
runs-on: ubuntu-latest
needs: [calculate-tag]
if: needs.calculate-tag.outputs.versionHash != needs.calculate-tag.outputs.latestHash
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: setup git
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- uses: actions/setup-go@v3
with:
go-version-file: act/go.mod
- uses: docker/setup-qemu-action@v2
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: |
make act-test
tag-release:
runs-on: ubuntu-latest
needs: ["calculate-tag", "build", "test"]
if: github.ref == 'refs/heads/distribution' && needs.calculate-tag.outputs.versionHash != needs.calculate-tag.outputs.latestHash
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: create release tag
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
make patch
# tag version on the superproject because the goreleaser action reads it
git tag -d "${{ needs.calculate-tag.outputs.tag }}" || true
git push origin --delete "${{ needs.calculate-tag.outputs.tag }}" || true
# push an annotated tag to have latest release sorted by taggerdate
git tag -m "${{ needs.calculate-tag.outputs.tag }}" "${{ needs.calculate-tag.outputs.tag }}"
git push --tags
# tag version in the submodule because goreleaser verifies that the tag is set on the current commit
cd act
git tag -d "${{ needs.calculate-tag.outputs.tag }}" || true
git tag "${{ needs.calculate-tag.outputs.tag }}"
- uses: actions/setup-go@v3
with:
go-version-file: act/go.mod
- name: GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
workdir: ./act
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: update patched-master branch
run: |
cd act
git checkout -b patched-master
git push --force origin patched-master