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

Release Automation #1254

Merged
merged 62 commits into from Jan 15, 2024
Merged

Release Automation #1254

merged 62 commits into from Jan 15, 2024

Conversation

art-divin
Copy link
Collaborator

@art-divin art-divin commented Jan 10, 2024

Context

This MR addresses #1247 in a way that macOS and Ubuntu release process is based on new GH actions:

  1. release_Ubuntu for Ubuntu release artifacts
  2. release_macOS for macOS release artifacts

Missing Parts

  1. homebrew formulae update is not migrated from Rakefile
  2. cocoapods update is not migrated from Rakefile
  3. version increase is not migrated from Rakefile

Pt. 3 means that to make successful release, rake release:update_metadata needs to be run manually before creating new tag

There's a new GH action called rake docs which is triggered for every master branch merge event. It generates new documentation and makes commit & push to master branch directly right from GH action.

To streamline, the following is the current release process:

  1. (Manual) Make sure that CHANGELOG.md has all entries for the new version
  2. (Manual) execute bundle install && rake release:update_metadata and after checking what was committed, git push
  3. (Manual) Create new release in https://github.com/krzysztofzablocki/Sourcery/releases
  4. (Manual) Create new tag for the new version
  5. (Manual) Generate release notes using GItHub release page feature
  6. Wait for completion of release_macOS and release_ubuntu actions
    6.1 (Manual) download macOS artifacts, unzip them, re-zip using zip -r -X <target.zip> <folder> - this is due to "double zip" in GH action
    6.2 (Manual) download ubuntu artifact, simply unzip it once to have tar.xz archive on hand
  7. (Manual) attach artifacts to the drafted release
  8. Done! ✅

Sequencing

  • release_Ubuntu will start when:
    -- new tag is pushed to remote
    -- test_Ubuntu is completed with success
    --- test_Ubuntu is triggered when release_Ubuntu starts
  • release_macOS will start when:
    -- new tag is pushed to remote
    -- test_macOS is completed with success
    --- test_macOS is triggered when release_macOS starts

Details

  1. macOS Sourcery executable contains the following architectures:
➜  Downloads lipo -info sourcery
Architectures in the fat file: sourcery are: x86_64 arm64 
  1. Ubuntu Sourcery executable contains the following architecture
file sourcery
sourcery: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped

Artifacts

Note

The artifacts are zip-ed additionally upon downloading (more info).
To correctly post artifacts in a new release, it is important to download them, unpack and re-zip again.
⚠️ Double-zipping is required in order to preserve a+x permission on sourcery binary

Linux Artifacts macOS Artifacts
image image
image image

@art-divin art-divin self-assigned this Jan 10, 2024
@art-divin art-divin added this to the Release Automation milestone Jan 10, 2024
@art-divin art-divin added the automated release Tasks related to release process automation label Jan 10, 2024
@art-divin art-divin modified the milestones: Release Automation, 2.1.4 Jan 15, 2024
@art-divin art-divin merged commit 38a6731 into master Jan 15, 2024
2 checks passed
@art-divin art-divin deleted the automate_release branch January 15, 2024 19:14
art-divin added a commit that referenced this pull request Jan 15, 2024
commit dfe4023
Author: art-divin <art-divin@users.noreply.github.com>
Date:   Mon Jan 15 19:22:10 2024 +0000

    Update Docs

commit 38a6731
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date:   Mon Jan 15 14:14:13 2024 -0500

    Release Automation (#1254)

    * new GH actions for release automation

    * updated Xcode version for macOS

    * updated actions

    * added pull request trigger [no-ci]

    * adjusted pull_request requirement for actions [no-ci]

    * fixed build errors for release builds

    * added libcurl4 dependency

    * added custom swift installation for lcurl issue

    * enabled fat binary for macOS release build

    * fixed typo

    * removed redundant spaces

    * fixed wrong reference

    * updated actions for ubuntu

    * fixed folder paths

    * fixed typo

    * debug - print build_dir

    * fixed build path for linux

    * fixed path for release binary

    * attempt to build on aarch64

    * removed attempt for aarch64

    * changed event type release created for artifacts

    * excluded *_Linux.swift files from documentation

    * added jazzy action

    * renamed actions

    * added test  dependencies for release jobs

    * removed pull_request trigger for jazzy

    * added missing jazzy dependency

    * allow test actions to be called

    * adjusted workflow name

    * testing

    * renamed release filename for ubuntu

    * disabled workflow_run for test

    * disabled on tags for testing

    * disabled check for test

    * removed apostrophes

    * added ls for test

    * test generating docs

    * fixed wrong variable

    * added job dependency

    * fixed wrong copy

    * install tac

    * exported variables between steps

    * migrated docs job into build

    * debugging ls

    * test run

    * debug ls

    * renamed archive file

    * moved final archive to ~

    * moved files to ~

    * flatten archive on ubuntu

    * flattened archives; fixed artifactbundle

    * changed packaging

    * removed redundant mv

    * fixed typo

    * replaced mv with cp

    * last test with docset

    * added missing jazzy setup

    * changed attributes for compiled binary

    * compressing before packaging

    * removed test triggers

    * enabled tests for PRs

    * renamed file
This was referenced Jan 15, 2024
art-divin added a commit that referenced this pull request Mar 17, 2024
* new GH actions for release automation

* updated Xcode version for macOS

* updated actions

* added pull request trigger [no-ci]

* adjusted pull_request requirement for actions [no-ci]

* fixed build errors for release builds

* added libcurl4 dependency

* added custom swift installation for lcurl issue

* enabled fat binary for macOS release build

* fixed typo

* removed redundant spaces

* fixed wrong reference

* updated actions for ubuntu

* fixed folder paths

* fixed typo

* debug - print build_dir

* fixed build path for linux

* fixed path for release binary

* attempt to build on aarch64

* removed attempt for aarch64

* changed event type release created for artifacts

* excluded *_Linux.swift files from documentation

* added jazzy action

* renamed actions

* added test  dependencies for release jobs

* removed pull_request trigger for jazzy

* added missing jazzy dependency

* allow test actions to be called

* adjusted workflow name

* testing

* renamed release filename for ubuntu

* disabled workflow_run for test

* disabled on tags for testing

* disabled check for test

* removed apostrophes

* added ls for test

* test generating docs

* fixed wrong variable

* added job dependency

* fixed wrong copy

* install tac

* exported variables between steps

* migrated docs job into build

* debugging ls

* test run

* debug ls

* renamed archive file

* moved final archive to ~

* moved files to ~

* flatten archive on ubuntu

* flattened archives; fixed artifactbundle

* changed packaging

* removed redundant mv

* fixed typo

* replaced mv with cp

* last test with docset

* added missing jazzy setup

* changed attributes for compiled binary

* compressing before packaging

* removed test triggers

* enabled tests for PRs

* renamed file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated release Tasks related to release process automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant