The osbuild release action cleans the repository, removing the tarball that gets uploaded to the release. This tarball needs to be built before schutzbot commits the version bump, so move it so it doesn't get cleaned.
44 lines
1.4 KiB
YAML
44 lines
1.4 KiB
YAML
name: "Create GitHub release"
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# create release artefact before creating the release to get the correct release in the
|
|
# artefact name.
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Use Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Make dist
|
|
run: |
|
|
make dist
|
|
RELEASE_NO=$(echo ${{github.ref_name}} | tr -d 'v')
|
|
mv "cockpit-image-builder-$RELEASE_NO.tar.gz" ../cockpit-image-builder-${{github.ref_name}}.tar.gz
|
|
|
|
# create release, which will bump the version
|
|
- name: Upstream release
|
|
uses: osbuild/release-action@main
|
|
with:
|
|
token: "${{ secrets.SCHUTZBOT_GITHUB_ACCESS_TOKEN }}"
|
|
slack_webhook_url: "${{ secrets.SLACK_WEBHOOK_URL }}"
|
|
|
|
# upload release artefact
|
|
# Source0 expands to `https://github.com/osbuild/image-builder-frontend/releases/download/v$VERSION/cockpit-image-builder-v$VERSION.tar.gz`,
|
|
# so the v needs to be in the tarball when we upload it as a release artefact.
|
|
- name: Upload release artefact
|
|
run: |
|
|
gh release upload ${{github.ref_name}} \
|
|
../cockpit-image-builder-${{github.ref_name}}.tar.gz
|