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

Change CI workflow to create a prelease first #28

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ on:
branches: [main]

concurrency:
group: release
group: prerelease
cancel-in-progress: true

jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -26,4 +30,4 @@ jobs:
- name: Run semantic-release
run: nix develop -c npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 5 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
name: Publish

on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
workflow_dispatch:
inputs:
tag:
description: The existing tag to publish
type: string
required: true
release:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oscar-izval to make things easier across all CI workflows, I believe it would be preferable to have semantic-release create a prerelease first, as this would allow us to perform a final check before pushing the button. On the other hand, I believe this would allow us to work around the problem with the workflow_dispatch you found. What are your thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! I'd love to see a fully automatic process, but I agree with you that we may not be there yet

types: [published]

concurrency:
group: publish
Expand All @@ -25,13 +19,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref_name }}
ref: ${{ github.ref_name }}
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
- name: Publish flake
uses: DeterminateSystems/flakehub-push@v3
with:
tag: ${{ inputs.tag || github.ref_name }}
tag: ${{ github.ref_name }}
visibility: public

flakestry:
Expand All @@ -40,4 +34,4 @@ jobs:
- name: Publish flake
uses: flakestry/flakestry-publish@645c2ab3c99b97f5f1abc383370ae5e72c9e7d9b
with:
version: ${{ inputs.tag || github.ref_name }}
version: ${{ github.ref_name }}
2 changes: 1 addition & 1 deletion .releaserc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
branches: [main]
branches: [{ name: main, prerelease: true }]
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/build.yml/badge.svg)](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/build.yml)
[![Update](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/update.yml/badge.svg)](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/update.yml)
[![Release](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/release.yml/badge.svg)](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/release.yml)
[![Prerelease](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/prerelease.yml/badge.svg)](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/prerelease.yml)
[![Publish](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/publish.yml/badge.svg)](https://github.com/stackbuilders/nixpkgs-terraform/actions/workflows/publish.yml)

[![FlakeHub](https://img.shields.io/endpoint?url=https://flakehub.com/f/stackbuilders/nixpkgs-terraform/badge)](https://flakehub.com/flake/stackbuilders/nixpkgs-terraform)
Expand Down